-
- All Superinterfaces:
io.netty5.util.concurrent.FuturePromiseFactory
- All Known Subinterfaces:
Channel,ChannelHandlerContext,ChannelPipeline,DatagramChannel,ServerChannel,ServerSocketChannel,SocketChannel
- All Known Implementing Classes:
AbstractChannel,AbstractChannel.DefaultAbstractChannelPipeline,AbstractNioByteChannel,AbstractNioChannel,AbstractNioMessageChannel,AbstractServerChannel,DefaultChannelPipeline,DelegatingChannelHandlerContext,EmbeddedChannel,LocalChannel,LocalServerChannel,NioDatagramChannel,NioServerSocketChannel,NioSocketChannel
public interface ChannelOutboundInvoker extends io.netty5.util.concurrent.FuturePromiseFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description io.netty5.util.concurrent.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.io.netty5.util.concurrent.Future<Void>close()Request to close theChanneland notify theFutureonce the operation completes, either because the operation was successful or because of an error.io.netty5.util.concurrent.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.io.netty5.util.concurrent.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.io.netty5.util.concurrent.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.io.netty5.util.concurrent.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.io.netty5.util.concurrent.EventExecutorexecutor()Returns theEventExecutorthat is used to execute the operations of thisChannelOutboundInvoker.ChannelOutboundInvokerflush()Request to flush all pending messages via this ChannelOutboundInvoker.default <V> io.netty5.util.concurrent.Future<V>newFailedFuture(Throwable cause)default <V> io.netty5.util.concurrent.Promise<V>newPromise()default io.netty5.util.concurrent.Future<Void>newSucceededFuture()default <V> io.netty5.util.concurrent.Future<V>newSucceededFuture(V value)ChannelOutboundInvokerread()ChannelOutboundInvokerread(ReadBufferAllocator readBufferAllocator)Request to read data from theChannel, triggers anChannelHandler.channelRead(ChannelHandlerContext, Object)event if data was read, and triggers achannelReadCompleteevent so the handler can decide to continue reading.io.netty5.util.concurrent.Future<Void>register()Request to register on theEventExecutorfor I/O processing.io.netty5.util.concurrent.Future<Void>sendOutboundEvent(Object event)Send a custom outbound event via thisChannelOutboundInvokerthrough theChannelPipeline.io.netty5.util.concurrent.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.io.netty5.util.concurrent.Future<Void>write(Object msg)Request to write a message via thisChannelHandlerContextthrough theChannelPipeline.io.netty5.util.concurrent.Future<Void>writeAndFlush(Object msg)Shortcut for callwrite(Object)andflush().
-
-
-
Method Detail
-
bind
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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
io.netty5.util.concurrent.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(ReadBufferAllocator readBufferAllocator)
Request to read data from theChannel, 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, ReadBufferAllocator)method called of the nextChannelHandlercontained in theChannelPipelineof theChannel.- Parameters:
readBufferAllocator- TheReadBufferAllocatorthat should be used to allocate aBufferif needed (for reading the data).
-
read
ChannelOutboundInvoker read()
- See Also:
(using a default ).
-
write
io.netty5.util.concurrent.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
io.netty5.util.concurrent.Future<Void> writeAndFlush(Object msg)
Shortcut for callwrite(Object)andflush().
-
sendOutboundEvent
io.netty5.util.concurrent.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> io.netty5.util.concurrent.Promise<V> newPromise()
- Specified by:
newPromisein interfaceio.netty5.util.concurrent.FuturePromiseFactory
-
newSucceededFuture
default <V> io.netty5.util.concurrent.Future<V> newSucceededFuture(V value)
- Specified by:
newSucceededFuturein interfaceio.netty5.util.concurrent.FuturePromiseFactory
-
newFailedFuture
default <V> io.netty5.util.concurrent.Future<V> newFailedFuture(Throwable cause)
- Specified by:
newFailedFuturein interfaceio.netty5.util.concurrent.FuturePromiseFactory
-
newSucceededFuture
default io.netty5.util.concurrent.Future<Void> newSucceededFuture()
- Specified by:
newSucceededFuturein interfaceio.netty5.util.concurrent.FuturePromiseFactory
-
executor
io.netty5.util.concurrent.EventExecutor executor()
Returns theEventExecutorthat is used to execute the operations of thisChannelOutboundInvoker.- Returns:
- the executor.
-
-