Interface ChannelOutboundInvoker
- All Known Subinterfaces:
Channel
,ChannelHandlerContext
,ChannelPipeline
,DatagramChannel
,DomainDatagramChannel
,DomainSocketChannel
,DuplexChannel
,Http2StreamChannel
,ServerChannel
,ServerDomainSocketChannel
,ServerSocketChannel
,SocketChannel
,UnixChannel
- All Known Implementing Classes:
AbstractChannel
,AbstractChannelHandlerContext
,AbstractEpollChannel
,AbstractEpollServerChannel
,AbstractEpollStreamChannel
,AbstractHttp2StreamChannel
,AbstractKQueueChannel
,AbstractKQueueDatagramChannel
,AbstractKQueueServerChannel
,AbstractKQueueStreamChannel
,AbstractNioByteChannel
,AbstractNioChannel
,AbstractNioMessageChannel
,AbstractOioByteChannel
,AbstractOioChannel
,AbstractOioMessageChannel
,AbstractServerChannel
,CombinedChannelDuplexHandler.DelegatingChannelHandlerContext
,DefaultChannelHandlerContext
,DefaultChannelPipeline
,DefaultChannelPipeline.HeadContext
,DefaultChannelPipeline.TailContext
,EmbeddedChannel
,EmbeddedChannel.EmbeddedChannelPipeline
,EpollDatagramChannel
,EpollDomainDatagramChannel
,EpollDomainSocketChannel
,EpollServerDomainSocketChannel
,EpollServerSocketChannel
,EpollSocketChannel
,FailedChannel
,Http2MultiplexCodec.Http2MultiplexCodecStreamChannel
,Http2MultiplexHandler.Http2MultiplexHandlerStreamChannel
,KQueueDatagramChannel
,KQueueDomainDatagramChannel
,KQueueDomainSocketChannel
,KQueueServerDomainSocketChannel
,KQueueServerSocketChannel
,KQueueSocketChannel
,LocalChannel
,LocalServerChannel
,NioDatagramChannel
,NioServerSocketChannel
,NioSocketChannel
,OioByteStreamChannel
,OioDatagramChannel
,OioServerSocketChannel
,OioSocketChannel
-
Method Summary
Modifier and TypeMethodDescriptionbind
(SocketAddress localAddress) Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.bind
(SocketAddress localAddress, ChannelPromise promise) Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.close()
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.close
(ChannelPromise promise) Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.connect
(SocketAddress remoteAddress) Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.connect
(SocketAddress remoteAddress, ChannelPromise promise) Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.connect
(SocketAddress remoteAddress, SocketAddress localAddress) Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.connect
(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.deregister
(ChannelPromise promise) Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.disconnect
(ChannelPromise promise) Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.flush()
Request to flush all pending messages via this ChannelOutboundInvoker.newFailedFuture
(Throwable cause) Create a newChannelFuture
which is marked as failed already.Return an newChannelProgressivePromise
Return a newChannelPromise
.Create a newChannelFuture
which is marked as succeeded already.read()
Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event so the handler can decide to continue reading.Return a special ChannelPromise which can be reused for different operations.Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.write
(Object msg, ChannelPromise promise) Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.writeAndFlush
(Object msg) Shortcut for callwrite(Object)
andflush()
.writeAndFlush
(Object msg, ChannelPromise promise) Shortcut for callwrite(Object, ChannelPromise)
andflush()
.
-
Method Details
-
bind
Request to bind to the givenSocketAddress
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
connect
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
connect
Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
disconnect
ChannelFuture disconnect()Request to disconnect from the remote peer and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
close
ChannelFuture close()Request to close theChannel
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
deregister
ChannelFuture deregister()Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
bind
Request to bind to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.bind(ChannelHandlerContext, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
connect
Request to connect to the givenSocketAddress
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelFuture
will be notified.If the connection fails because of a connection timeout, the
ChannelFuture
will get failed with aConnectTimeoutException
. If it fails because of connection refused aConnectException
will be used.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
connect
ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) Request to connect to the givenSocketAddress
while bind to the localAddress and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified and also returned.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
disconnect
Request to disconnect from the remote peer and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.disconnect(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
close
Request to close theChannel
and notify theChannelFuture
once 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 givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.close(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
deregister
Request to deregister from the previous assignedEventExecutor
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error. The givenChannelPromise
will be notified.This will result in having the
ChannelOutboundHandler.deregister(ChannelHandlerContext, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
read
ChannelOutboundInvoker read()Request to Read data from theChannel
into the first inbound buffer, triggers anChannelInboundHandler.channelRead(ChannelHandlerContext, Object)
event if data was read, and triggers achannelReadComplete
event 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 nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
. -
write
Request to write a message via thisChannelHandlerContext
through 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
Request to write a message via thisChannelHandlerContext
through 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
Shortcut for callwrite(Object, ChannelPromise)
andflush()
. -
writeAndFlush
Shortcut for callwrite(Object)
andflush()
. -
newPromise
ChannelPromise newPromise()Return a newChannelPromise
. -
newProgressivePromise
ChannelProgressivePromise newProgressivePromise()Return an newChannelProgressivePromise
-
newSucceededFuture
ChannelFuture newSucceededFuture()Create a newChannelFuture
which is marked as succeeded already. SoFuture.isSuccess()
will returntrue
. AllFutureListener
added to it will be notified directly. Also every call of blocking methods will just return without blocking. -
newFailedFuture
Create a newChannelFuture
which is marked as failed already. SoFuture.isSuccess()
will returnfalse
. AllFutureListener
added 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!ChannelPromise
will 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.
-