Rename Reactor support classes
This change modifies the names of the Reactor support classes in order to align with the same changes in the 4.0.x line which now supports both Reactor 1.1 and 1.0. Issue: SPR-11636
This commit is contained in:
@@ -33,7 +33,7 @@ import java.nio.ByteBuffer;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class StompCodec implements Codec<Buffer, Message<byte[]>, Message<byte[]>> {
|
||||
public class Reactor11StompCodec implements Codec<Buffer, Message<byte[]>, Message<byte[]>> {
|
||||
|
||||
private final StompDecoder stompDecoder;
|
||||
|
||||
@@ -42,11 +42,11 @@ public class StompCodec implements Codec<Buffer, Message<byte[]>, Message<byte[]
|
||||
private final Function<Message<byte[]>, Buffer> encodingFunction;
|
||||
|
||||
|
||||
public StompCodec() {
|
||||
public Reactor11StompCodec() {
|
||||
this(new StompEncoder(), new StompDecoder());
|
||||
}
|
||||
|
||||
public StompCodec(StompEncoder encoder, StompDecoder decoder) {
|
||||
public Reactor11StompCodec(StompEncoder encoder, StompDecoder decoder) {
|
||||
Assert.notNull(encoder, "'encoder' is required");
|
||||
Assert.notNull(decoder, "'decoder' is required");
|
||||
this.stompEncoder = encoder;
|
||||
@@ -35,7 +35,7 @@ import org.springframework.messaging.tcp.FixedIntervalReconnectStrategy;
|
||||
import org.springframework.messaging.tcp.TcpConnection;
|
||||
import org.springframework.messaging.tcp.TcpConnectionHandler;
|
||||
import org.springframework.messaging.tcp.TcpOperations;
|
||||
import org.springframework.messaging.tcp.reactor.ReactorTcpClient;
|
||||
import org.springframework.messaging.tcp.reactor.Reactor11TcpClient;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
import org.springframework.util.concurrent.ListenableFutureCallback;
|
||||
@@ -311,7 +311,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
|
||||
/**
|
||||
* Configure a TCP client for managing TCP connections to the STOMP broker.
|
||||
* By default {@link org.springframework.messaging.tcp.reactor.ReactorTcpClient} is used.
|
||||
* By default {@link org.springframework.messaging.tcp.reactor.Reactor11TcpClient} is used.
|
||||
*/
|
||||
public void setTcpClient(TcpOperations<byte[]> tcpClient) {
|
||||
this.tcpClient = tcpClient;
|
||||
@@ -354,7 +354,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
if (this.tcpClient == null) {
|
||||
StompDecoder decoder = new StompDecoder();
|
||||
decoder.setHeaderInitializer(getHeaderInitializer());
|
||||
StompCodec codec = new StompCodec(new StompEncoder(), decoder);
|
||||
Reactor11StompCodec codec = new Reactor11StompCodec(new StompEncoder(), decoder);
|
||||
this.tcpClient = new StompTcpClientFactory().create(this.relayHost, this.relayPort, codec);
|
||||
}
|
||||
|
||||
@@ -838,8 +838,8 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
|
||||
|
||||
private static class StompTcpClientFactory {
|
||||
|
||||
public TcpOperations<byte[]> create(String relayHost, int relayPort, StompCodec codec) {
|
||||
return new ReactorTcpClient<byte[]>(relayHost, relayPort, codec);
|
||||
public TcpOperations<byte[]> create(String relayHost, int relayPort, Reactor11StompCodec codec) {
|
||||
return new Reactor11TcpClient<byte[]>(relayHost, relayPort, codec);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ import reactor.tuple.Tuple2;
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.0
|
||||
*/
|
||||
public class ReactorTcpClient<P> implements TcpOperations<P> {
|
||||
public class Reactor11TcpClient<P> implements TcpOperations<P> {
|
||||
|
||||
public static final Class<NettyTcpClient> REACTOR_TCP_CLIENT_TYPE = NettyTcpClient.class;
|
||||
|
||||
@@ -77,7 +77,7 @@ public class ReactorTcpClient<P> implements TcpOperations<P> {
|
||||
* @param port the port to connect to
|
||||
* @param codec the codec to use for encoding and decoding the TCP stream
|
||||
*/
|
||||
public ReactorTcpClient(String host, int port, Codec<Buffer, Message<P>, Message<P>> codec) {
|
||||
public Reactor11TcpClient(String host, int port, Codec<Buffer, Message<P>, Message<P>> codec) {
|
||||
|
||||
// Revisit in 1.1: is Environment still required w/ sync dispatcher?
|
||||
this.environment = new Environment(new SynchronousDispatcherConfigReader());
|
||||
@@ -98,7 +98,7 @@ public class ReactorTcpClient<P> implements TcpOperations<P> {
|
||||
*
|
||||
* @param tcpClient the TcpClient to use
|
||||
*/
|
||||
public ReactorTcpClient(TcpClient<Message<P>, Message<P>> tcpClient) {
|
||||
public Reactor11TcpClient(TcpClient<Message<P>, Message<P>> tcpClient) {
|
||||
Assert.notNull(tcpClient, "'tcpClient' must not be null");
|
||||
this.tcpClient = tcpClient;
|
||||
this.environment = null;
|
||||
@@ -178,7 +178,7 @@ public class ReactorTcpClient<P> implements TcpOperations<P> {
|
||||
connectionHandler.afterConnectionClosed();
|
||||
}
|
||||
});
|
||||
connectionHandler.afterConnected(new ReactorTcpConnection<P>(connection));
|
||||
connectionHandler.afterConnected(new Reactor11TcpConnection<P>(connection));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -33,12 +33,12 @@ import reactor.net.NetChannel;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class ReactorTcpConnection<P> implements TcpConnection<P> {
|
||||
public class Reactor11TcpConnection<P> implements TcpConnection<P> {
|
||||
|
||||
private final NetChannel<Message<P>, Message<P>> channel;
|
||||
|
||||
|
||||
public ReactorTcpConnection(NetChannel<Message<P>, Message<P>> connection) {
|
||||
public Reactor11TcpConnection(NetChannel<Message<P>, Message<P>> connection) {
|
||||
this.channel = connection;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user