public class ReactorNettyTcpClient<P> extends java.lang.Object implements TcpOperations<P>
TcpOperations.| Modifier and Type | Class and Description |
|---|---|
private class |
ReactorNettyTcpClient.ReactorNettyHandler |
private static class |
ReactorNettyTcpClient.StompMessageDecoder<P> |
| Modifier and Type | Field and Description |
|---|---|
private ChannelGroup |
channelGroup |
private ReactorNettyCodec<P> |
codec |
private LoopResources |
loopResources |
private PoolResources |
poolResources |
private Scheduler |
scheduler |
private boolean |
stopping |
private TcpClient |
tcpClient |
| Constructor and Description |
|---|
ReactorNettyTcpClient(java.util.function.Consumer<ClientOptions> optionsConsumer,
ReactorNettyCodec<P> codec)
Alternate constructor with a
ClientOptions consumer providing
additional control beyond a host and a port. |
ReactorNettyTcpClient(java.lang.String host,
int port,
ReactorNettyCodec<P> codec)
Basic constructor with a host and a port.
|
| Modifier and Type | Method and Description |
|---|---|
ListenableFuture<java.lang.Void> |
connect(TcpConnectionHandler<P> handler)
Open a new connection.
|
ListenableFuture<java.lang.Void> |
connect(TcpConnectionHandler<P> handler,
ReconnectStrategy strategy)
Open a new connection and a strategy for reconnecting if the connection fails.
|
private ListenableFuture<java.lang.Void> |
handleShuttingDownConnectFailure(TcpConnectionHandler<P> handler) |
private <T> java.util.function.Function<<any>,<any>> |
reconnectFunction(ReconnectStrategy reconnectStrategy) |
ListenableFuture<java.lang.Void> |
shutdown()
Shut down and close any open connections.
|
private void |
shutdownGlobalResources() |
private <T> java.util.function.Consumer<T> |
updateConnectMono(<any> connectMono) |
private final TcpClient tcpClient
private final ReactorNettyCodec<P> codec
private final ChannelGroup channelGroup
private final LoopResources loopResources
private final PoolResources poolResources
private final Scheduler scheduler
private volatile boolean stopping
public ReactorNettyTcpClient(java.lang.String host,
int port,
ReactorNettyCodec<P> codec)
public ReactorNettyTcpClient(java.util.function.Consumer<ClientOptions> optionsConsumer,
ReactorNettyCodec<P> codec)
ClientOptions consumer providing
additional control beyond a host and a port.public ListenableFuture<java.lang.Void> connect(TcpConnectionHandler<P> handler)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionpublic ListenableFuture<java.lang.Void> connect(TcpConnectionHandler<P> handler, ReconnectStrategy strategy)
TcpOperationsconnect in interface TcpOperations<P>handler - a handler to manage the connectionstrategy - a strategy for reconnectingprivate ListenableFuture<java.lang.Void> handleShuttingDownConnectFailure(TcpConnectionHandler<P> handler)
private <T> java.util.function.Consumer<T> updateConnectMono(<any> connectMono)
private <T> java.util.function.Function<<any>,<any>> reconnectFunction(ReconnectStrategy reconnectStrategy)
public ListenableFuture<java.lang.Void> shutdown()
TcpOperationsshutdown in interface TcpOperations<P>private void shutdownGlobalResources()