Renamed MessageBus to Binder
- Renamed MessageBus to Binder - Parameterized Binder interface - Restored exclusion of spring-xd-codec
This commit is contained in:
committed by
Marius Bogoevici
parent
11e9f269db
commit
35b74b00b3
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.xd.dirt.integration.bus.serializer;
|
||||
|
||||
|
||||
import org.springframework.cloud.stream.exception.CloudStreamsRuntimeException;
|
||||
|
||||
/**
|
||||
* Thrown when something goes wrong with inter-module communication.
|
||||
*
|
||||
* @author David Turanski
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SerializationException extends CloudStreamsRuntimeException {
|
||||
|
||||
public SerializationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public SerializationException(String message, Throwable t) {
|
||||
super(message, t);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import com.esotericsoftware.kryo.Registration;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import org.springframework.xd.dirt.integration.bus.serializer.SerializationException;
|
||||
import org.springframework.core.serializer.support.SerializationFailedException;
|
||||
|
||||
/**
|
||||
* @author David Turanski
|
||||
@@ -38,7 +38,7 @@ public abstract class AbstractKryoRegistrar implements KryoRegistrar {
|
||||
register(kryo, registration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public abstract List<Registration> getRegistrations();
|
||||
|
||||
protected void register(Kryo kryo, Registration registration) {
|
||||
@@ -47,11 +47,11 @@ public abstract class AbstractKryoRegistrar implements KryoRegistrar {
|
||||
Registration existing = kryo.getRegistration(id);
|
||||
|
||||
if (existing != null) {
|
||||
throw new SerializationException(String.format("registration already exists %s", existing));
|
||||
throw new SerializationFailedException(String.format("registration already exists %s", existing));
|
||||
}
|
||||
|
||||
log.info("registering {} with serializer {}", registration, registration.getSerializer().getClass()
|
||||
.getName());
|
||||
.getName());
|
||||
|
||||
kryo.register(registration);
|
||||
}
|
||||
|
||||
@@ -20,9 +20,9 @@ import java.util.List;
|
||||
|
||||
import com.esotericsoftware.kryo.Registration;
|
||||
|
||||
import org.springframework.core.serializer.support.SerializationFailedException;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.xd.dirt.integration.bus.serializer.SerializationException;
|
||||
|
||||
/**
|
||||
* A {@link KryoRegistrar} that delegates and validates
|
||||
@@ -37,7 +37,7 @@ public class CompositeKryoRegistrar extends AbstractKryoRegistrar {
|
||||
public CompositeKryoRegistrar(List<KryoRegistrar> delegates) {
|
||||
super();
|
||||
this.delegates = delegates;
|
||||
|
||||
|
||||
if (!CollectionUtils.isEmpty(this.delegates)) {
|
||||
validateRegistrations();
|
||||
}
|
||||
@@ -60,18 +60,18 @@ public class CompositeKryoRegistrar extends AbstractKryoRegistrar {
|
||||
Assert.isTrue(registration.getId() >= MIN_REGISTRATION_VALUE, "registration ID must be >= " +
|
||||
MIN_REGISTRATION_VALUE);
|
||||
if (ids.contains(registration.getId())) {
|
||||
throw new SerializationException(String.format("Duplicate registration ID found: %d",
|
||||
throw new SerializationFailedException(String.format("Duplicate registration ID found: %d",
|
||||
registration.getId()));
|
||||
}
|
||||
ids.add(registration.getId());
|
||||
|
||||
if (types.contains(registration.getType())) {
|
||||
throw new SerializationException(String.format("Duplicate registration found for type: %s",
|
||||
throw new SerializationFailedException(String.format("Duplicate registration found for type: %s",
|
||||
registration.getType()));
|
||||
}
|
||||
types.add(registration.getType());
|
||||
|
||||
log.info("configured Kryo registration {} with serializer {}", registration,
|
||||
log.info("configured Kryo registration {} with serializer {}", registration,
|
||||
registration.getSerializer().getClass().getName());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user