Interface ChannelOutboundInvoker
-
- All Known Subinterfaces:
Channel,ChannelHandlerContext,ChannelPipeline,DatagramChannel,DomainDatagramChannel,DomainSocketChannel,DuplexChannel,Http2StreamChannel,QuicChannel,QuicStreamChannel,SctpChannel,SctpServerChannel,ServerChannel,ServerDomainSocketChannel,ServerSocketChannel,SocketChannel,UdtChannel,UdtServerChannel,UnixChannel
- All Known Implementing Classes:
AbstractChannel,AbstractEpollServerChannel,AbstractEpollStreamChannel,AbstractKQueueServerChannel,AbstractKQueueStreamChannel,AbstractNioByteChannel,AbstractNioChannel,AbstractNioMessageChannel,AbstractOioByteChannel,AbstractOioChannel,AbstractOioMessageChannel,AbstractServerChannel,DefaultChannelPipeline,EmbeddedChannel,EpollDatagramChannel,EpollDomainDatagramChannel,EpollDomainSocketChannel,EpollServerDomainSocketChannel,EpollServerSocketChannel,EpollSocketChannel,IoUringDatagramChannel,IoUringDomainSocketChannel,IoUringServerDomainSocketChannel,IoUringServerSocketChannel,IoUringSocketChannel,KQueueDatagramChannel,KQueueDomainDatagramChannel,KQueueDomainSocketChannel,KQueueServerDomainSocketChannel,KQueueServerSocketChannel,KQueueSocketChannel,LocalChannel,LocalServerChannel,NioDatagramChannel,NioDomainSocketChannel,NioSctpChannel,NioSctpServerChannel,NioServerDomainSocketChannel,NioServerSocketChannel,NioSocketChannel,NioUdtAcceptorChannel,NioUdtByteAcceptorChannel,NioUdtByteConnectorChannel,NioUdtByteRendezvousChannel,NioUdtMessageAcceptorChannel,NioUdtMessageConnectorChannel,NioUdtMessageRendezvousChannel,OioByteStreamChannel,OioDatagramChannel,OioSctpChannel,OioSctpServerChannel,OioServerSocketChannel,OioSocketChannel,RxtxChannel
public interface ChannelOutboundInvoker
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ChannelFuturebind(java.net.SocketAddress localAddress)Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturebind(java.net.SocketAddress localAddress, ChannelPromise promise)Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureclose()Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureclose(ChannelPromise promise)Request to close theChanneland notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(java.net.SocketAddress remoteAddress)Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress, ChannelPromise promise)Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFutureconnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFutureconnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturederegister()Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturederegister(ChannelPromise promise)Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.default ChannelFuturedisconnect()Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelFuturedisconnect(ChannelPromise promise)Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.ChannelOutboundInvokerflush()Request to flush all pending messages via this ChannelOutboundInvoker.ChannelFuturenewFailedFuture(java.lang.Throwable cause)Create a newChannelFuturewhich is marked as failed already.ChannelProgressivePromisenewProgressivePromise()Return an newChannelProgressivePromiseChannelPromisenewPromise()Return a newChannelPromise.ChannelFuturenewSucceededFuture()Create a newChannelFuturewhich is marked as succeeded already.ChannelOutboundInvokerread()Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.ChannelPromisevoidPromise()Return a special ChannelPromise which can be reused for different operations.default ChannelFuturewrite(java.lang.Object msg)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.ChannelFuturewrite(java.lang.Object msg, ChannelPromise promise)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.default ChannelFuturewriteAndFlush(java.lang.Object msg)Shortcut for callwrite(Object)andflush().ChannelFuturewriteAndFlush(java.lang.Object msg, ChannelPromise promise)Shortcut for callwrite(Object, ChannelPromise)andflush().
-
-
-
Method Detail
-
bind
default ChannelFuture bind(java.net.SocketAddress localAddress)
Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress)
Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
connect
default ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
disconnect
default ChannelFuture disconnect()
Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
close
default ChannelFuture close()
Request to close theChanneland notify theChannelFutureonce 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
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
deregister
default ChannelFuture deregister()
Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
bind
ChannelFuture bind(java.net.SocketAddress localAddress, ChannelPromise promise)
Request to bind to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
connect
ChannelFuture connect(java.net.SocketAddress remoteAddress, ChannelPromise promise)
Request to connect to the givenSocketAddressand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelFuturewill be notified.If the connection fails because of a connection timeout, the
ChannelFuturewill get failed with aConnectTimeoutException. If it fails because of connection refused aConnectExceptionwill be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
connect
ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress, ChannelPromise promise)
Request to connect to the givenSocketAddresswhile bind to the localAddress and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
disconnect
ChannelFuture disconnect(ChannelPromise promise)
Request to disconnect from the remote peer and notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
close
ChannelFuture close(ChannelPromise promise)
Request to close theChanneland notify theChannelFutureonce 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. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
deregister
ChannelFuture deregister(ChannelPromise promise)
Request to deregister from the previous assignedEventExecutorand notify theChannelFutureonce the operation completes, either because the operation was successful or because of an error. The givenChannelPromisewill be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
read
ChannelOutboundInvoker read()
Request to Read data from theChannelinto the first inbound buffer, triggers anChannelInboundHandler.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
ChannelOutboundHandler.read(ChannelHandlerContext)method called of the nextChannelOutboundHandlercontained in theChannelPipelineof theChannel.
-
write
default ChannelFuture write(java.lang.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.
-
write
ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
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
ChannelFuture writeAndFlush(java.lang.Object msg, ChannelPromise promise)
Shortcut for callwrite(Object, ChannelPromise)andflush().
-
writeAndFlush
default ChannelFuture writeAndFlush(java.lang.Object msg)
Shortcut for callwrite(Object)andflush().
-
newPromise
ChannelPromise newPromise()
Return a newChannelPromise.
-
newProgressivePromise
ChannelProgressivePromise newProgressivePromise()
Return an newChannelProgressivePromise
-
newSucceededFuture
ChannelFuture newSucceededFuture()
Create a newChannelFuturewhich is marked as succeeded already. SoFuture.isSuccess()will returntrue. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.
-
newFailedFuture
ChannelFuture newFailedFuture(java.lang.Throwable cause)
Create a newChannelFuturewhich is marked as failed already. SoFuture.isSuccess()will returnfalse. AllFutureListeneradded to it will be notified directly. Also every call of blocking methods will just return without blocking.
-
voidPromise
ChannelPromise voidPromise()
Return a special ChannelPromise which can be reused for different operations.It's only supported to use it for
write(Object, ChannelPromise).Be aware that the returned
Be aware this is an expert feature and should be used with care!ChannelPromisewill not support most operations and should only be used if you want to save an object allocation for every write operation. You will not be able to detect if the operation was complete, only if it failed as the implementation will callChannelPipeline.fireExceptionCaught(Throwable)in this case.
-
-