-
- All Superinterfaces:
FuturePromiseFactory
- All Known Subinterfaces:
Channel,ChannelHandlerContext,ChannelPipeline,DatagramChannel,Http2StreamChannel,ServerChannel,ServerSocketChannel,SocketChannel,UnixChannel
- All Known Implementing Classes:
AbstractChannel,AbstractChannel.DefaultAbstractChannelPipeline,AbstractNioByteChannel,AbstractNioChannel,AbstractNioMessageChannel,AbstractServerChannel,DefaultChannelPipeline,DelegatingChannelHandlerContext,EmbeddedChannel,EpollDatagramChannel,EpollServerSocketChannel,EpollSocketChannel,KQueueDatagramChannel,KQueueServerSocketChannel,KQueueSocketChannel,LocalChannel,LocalServerChannel,NioDatagramChannel,NioServerSocketChannel,NioSocketChannel
public interface ChannelOutboundInvoker extends FuturePromiseFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Future<Void>bind(SocketAddress localAddress)Request to bind to the givenSocketAddressand notify theFutureonce the operation completes, either because the operation was successful or because of an error.Future<Void>close()Future<Void>connect(SocketAddress remoteAddress)Request to connect to the givenSocketAddressand notify theFutureonce the operation completes, either because the operation was successful or because of an error.Future<Void>connect(SocketAddress remoteAddress, SocketAddress localAddress)Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theFutureonce the operation completes, either because the operation was successful or because of an error.Future<Void>deregister()Request to deregister from the previous assignedEventExecutorand notify theFutureonce the operation completes, either because the operation was successful or because of an error.Future<Void>disconnect()Request to disconnect from the remote peer and notify theFutureonce the operation completes, either because the operation was successful or because of an error.EventExecutorexecutor()Returns theEventExecutorthat is used to execute the operations of thisChannelOutboundInvoker.ChannelOutboundInvokerflush()Request to flush all pending messages via this ChannelOutboundInvoker.default <V> Future<V>newFailedFuture(Throwable cause)Create a newFuturewhich is marked as failed already.default <V> Promise<V>newPromise()Return a newPromise.default Future<Void>newSucceededFuture()Create a newFuturewhich is marked as succeeded already.default <V> Future<V>newSucceededFuture(V value)Create a newFuturewhich is marked as succeeded already.ChannelOutboundInvokerread()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.Future<Void>register()Request to register on theEventExecutorfor I/O processing.Future<Void>sendOutboundEvent(Object event)Send a custom outbound event via thisChannelOutboundInvokerthrough theChannelPipeline.Future<Void>shutdown(ChannelShutdownDirection direction)Future<Void>write(Object msg)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.Future<Void>writeAndFlush(Object msg)Shortcut for callwrite(Object)andflush().
-
-
-
Method Detail
-
bind
Future<Void> bind(SocketAddress localAddress)
Request to bind to the givenSocketAddressand notify theFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelHandler.bind(ChannelHandlerContext, SocketAddress)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
connect
Future<Void> connect(SocketAddress remoteAddress)
Request to connect to the givenSocketAddressand notify theFutureonce the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
Futurewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
connect
Future<Void> connect(SocketAddress remoteAddress, SocketAddress localAddress)
Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
disconnect
Future<Void> disconnect()
Request to disconnect from the remote peer and notify theFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelHandler.disconnect(ChannelHandlerContext)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
close
Future<Void> close()
Request to close theChanneland notify theFutureonce the operation completes, either because the operation was successful or because of an error. After it is closed it is not possible to reuse it again.This will result in having the
ChannelHandler.close(ChannelHandlerContext)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
shutdown
Future<Void> shutdown(ChannelShutdownDirection direction)
Request shutdown one direction of theChanneland notify theFutureonce the operation completes, either because the operation was successful or because of an error.When completed, the channel will either not produce any inbound data anymore, or it will not be possible to write data anymore, depending on the given
ChannelShutdownDirection.Depending on the transport implementation shutting down the
ChannelShutdownDirection.OutboundorChannelShutdownDirection.Inboundmight also result in data transferred over the network. Like for example in case of TCP shutting down theChannelShutdownDirection.Outboundwill result in aFINthat is transmitted to the remote peer that will as a result shutdownChannelShutdownDirection.Inbound.This will result in having the
ChannelHandler.shutdown(ChannelHandlerContext, ChannelShutdownDirection). method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
register
Future<Void> register()
Request to register on theEventExecutorfor I/O processing.Futureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelHandler.register(ChannelHandlerContext)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
deregister
Future<Void> deregister()
Request to deregister from the previous assignedEventExecutorand notify theFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelHandler.deregister(ChannelHandlerContext)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
read
ChannelOutboundInvoker read()
Request to Read data from theChannelinto the first inbound buffer, triggers anChannelHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading. If there's a pending read operation already, this method does nothing.This will result in having the
ChannelHandler.read(ChannelHandlerContext)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
write
Future<Void> write(Object msg)
Request to write a message via thisChannelHandlerContextthrough theChannelPipeline. This method will not request to actual flush, so be sure to callflush()once you want to request to flush all pending data to the actual transport.
-
flush
ChannelOutboundInvoker flush()
Request to flush all pending messages via this ChannelOutboundInvoker.
-
writeAndFlush
Future<Void> writeAndFlush(Object msg)
Shortcut for callwrite(Object)andflush().
-
sendOutboundEvent
Future<Void> sendOutboundEvent(Object event)
Send a custom outbound event via thisChannelOutboundInvokerthrough theChannelPipeline.This will result in having the
ChannelHandler.sendOutboundEvent(ChannelHandlerContext, Object)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.
-
newPromise
default <V> Promise<V> newPromise()
Description copied from interface:FuturePromiseFactoryReturn a newPromise.- Specified by:
newPromisein interfaceFuturePromiseFactory
-
newSucceededFuture
default <V> Future<V> newSucceededFuture(V value)
Description copied from interface:FuturePromiseFactoryCreate a newFuturewhich is marked as succeeded already. SoAsynchronousResult.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuturein interfaceFuturePromiseFactory
-
newFailedFuture
default <V> Future<V> newFailedFuture(Throwable cause)
Description copied from interface:FuturePromiseFactoryCreate a newFuturewhich is marked as failed already. SoAsynchronousResult.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newFailedFuturein interfaceFuturePromiseFactory
-
newSucceededFuture
default Future<Void> newSucceededFuture()
Description copied from interface:FuturePromiseFactoryCreate a newFuturewhich is marked as succeeded already. SoAsynchronousResult.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.- Specified by:
newSucceededFuturein interfaceFuturePromiseFactory
-
executor
EventExecutor executor()
Returns theEventExecutorthat is used to execute the operations of thisChannelOutboundInvoker.- Returns:
- the executor.
-
-