Interface ChannelOutboundInvoker
-
- All Known Subinterfaces:
Channel
,ChannelHandlerContext
,ChannelPipeline
,DatagramChannel
,DomainDatagramChannel
,DomainSocketChannel
,DuplexChannel
,Http2StreamChannel
,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
,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 ChannelFuture
bind(java.net.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.ChannelFuture
bind(java.net.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.default ChannelFuture
close()
Request to close theChannel
and notify theChannelFuture
once the operation completes, either because the operation was successful or because of an error.ChannelFuture
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.default ChannelFuture
connect(java.net.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.ChannelFuture
connect(java.net.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.default ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.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.ChannelFuture
connect(java.net.SocketAddress remoteAddress, java.net.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.default 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.ChannelFuture
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.default 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.ChannelFuture
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.ChannelOutboundInvoker
flush()
Request to flush all pending messages via this ChannelOutboundInvoker.ChannelFuture
newFailedFuture(java.lang.Throwable cause)
Create a newChannelFuture
which is marked as failed already.ChannelProgressivePromise
newProgressivePromise()
Return an newChannelProgressivePromise
ChannelPromise
newPromise()
Return a newChannelPromise
.ChannelFuture
newSucceededFuture()
Create a newChannelFuture
which is marked as succeeded already.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.ChannelPromise
voidPromise()
Return a special ChannelPromise which can be reused for different operations.default ChannelFuture
write(java.lang.Object msg)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.ChannelFuture
write(java.lang.Object msg, ChannelPromise promise)
Request to write a message via thisChannelHandlerContext
through theChannelPipeline
.default ChannelFuture
writeAndFlush(java.lang.Object msg)
Shortcut for callwrite(Object)
andflush()
.ChannelFuture
writeAndFlush(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 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
default ChannelFuture connect(java.net.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.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
default ChannelFuture connect(java.net.SocketAddress remoteAddress, java.net.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.This will result in having the
ChannelOutboundHandler.connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)
method called of the nextChannelOutboundHandler
contained in theChannelPipeline
of theChannel
.
-
disconnect
default 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
default 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
default 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
ChannelFuture bind(java.net.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. 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
ChannelFuture connect(java.net.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. 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(java.net.SocketAddress remoteAddress, java.net.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
ChannelFuture 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. 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
ChannelFuture 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. 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
ChannelFuture 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. 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
default ChannelFuture write(java.lang.Object msg)
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
ChannelFuture write(java.lang.Object msg, ChannelPromise promise)
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
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 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
ChannelFuture newFailedFuture(java.lang.Throwable cause)
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.
-
-