Top Methods
io.netty.channel

public Interface ChannelOutboundInvoker

Known Direct Subinterfaces
io.netty.channel.ChannelPipeline, io.netty.channel.Channel, io.netty.channel.ChannelHandlerContext
Imports
io.netty.util.concurrent.EventExecutor, .FutureListener, java.net.ConnectException, .SocketAddress

Method Summary

Modifier and TypeMethod and Description
public ChannelFuture
bind(SocketAddress localAddress)

Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
bind(SocketAddress localAddress, ChannelPromise promise)

Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
close()

Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
close(ChannelPromise promise)

Request to close the Channel and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
connect(SocketAddress remoteAddress)

Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
connect(SocketAddress remoteAddress, SocketAddress localAddress)

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
connect(SocketAddress remoteAddress, ChannelPromise promise)

Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
deregister()

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
deregister(ChannelPromise promise)

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
disconnect()

Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelFuture
disconnect(ChannelPromise promise)

Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error.

public ChannelOutboundInvoker
flush()

Request to flush all pending messages via this ChannelOutboundInvoker.

public ChannelFuture
newFailedFuture(Throwable cause)

Create a new ChannelFuture which is marked as failed already.

public ChannelProgressivePromise
public ChannelPromise
newPromise()

Return a new ChannelPromise.

public ChannelFuture
newSucceededFuture()

Create a new ChannelFuture which is marked as succeeded already.

public ChannelOutboundInvoker
read()

Request to Read data from the Channel into the first inbound buffer, triggers an ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete event so the handler can decide to continue reading.

public ChannelPromise
voidPromise()

Return a special ChannelPromise which can be reused for different operations.

public ChannelFuture
write(Object msg)

Request to write a message via this ChannelHandlerContext through the ChannelPipeline.

public ChannelFuture
write(Object msg, ChannelPromise promise)

Request to write a message via this ChannelHandlerContext through the ChannelPipeline.

public ChannelFuture
public ChannelFuture
writeAndFlush(Object msg)

Shortcut for call write(Object) and flush().

Method Detail

bindback to summary
public ChannelFuture bind(SocketAddress localAddress)

Request to bind to the given SocketAddress and notify the ChannelFuture 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

bindback to summary
public ChannelFuture bind(SocketAddress localAddress, ChannelPromise promise)

Request to bind to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

This will result in having the ChannelOutboundHandler#bind(ChannelHandlerContext, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

closeback to summary
public ChannelFuture close()

Request to close the Channel and notify the ChannelFuture 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

closeback to summary
public ChannelFuture close(ChannelPromise promise)

Request to close the Channel and notify the ChannelFuture 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 given ChannelPromise will be notified.

This will result in having the ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

connectback to summary
public ChannelFuture connect(SocketAddress remoteAddress)

Request to connect to the given SocketAddress and notify the ChannelFuture 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 a ConnectTimeoutException. If it fails because of connection refused a ConnectException will be used.

This will result in having the ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

connectback to summary
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress)

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

connectback to summary
public ChannelFuture connect(SocketAddress remoteAddress, ChannelPromise promise)

Request to connect to the given SocketAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelFuture will be notified.

If the connection fails because of a connection timeout, the ChannelFuture will get failed with a ConnectTimeoutException. If it fails because of connection refused a ConnectException will be used.

This will result in having the ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

connectback to summary
public ChannelFuture connect(SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise)

Request to connect to the given SocketAddress while bind to the localAddress and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified and also returned.

This will result in having the ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

deregisterback to summary
public ChannelFuture deregister()

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

deregisterback to summary
public ChannelFuture deregister(ChannelPromise promise)

Request to deregister from the previous assigned EventExecutor and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

This will result in having the ChannelOutboundHandler#deregister(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

disconnectback to summary
public ChannelFuture disconnect()

Request to disconnect from the remote peer and notify the ChannelFuture 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

disconnectback to summary
public ChannelFuture disconnect(ChannelPromise promise)

Request to disconnect from the remote peer and notify the ChannelFuture once the operation completes, either because the operation was successful or because of an error. The given ChannelPromise will be notified.

This will result in having the ChannelOutboundHandler#disconnect(ChannelHandlerContext, ChannelPromise) method called of the next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

flushback to summary
public ChannelOutboundInvoker flush()

Request to flush all pending messages via this ChannelOutboundInvoker.

newFailedFutureback to summary
public ChannelFuture newFailedFuture(Throwable cause)

Create a new ChannelFuture which is marked as failed already. So ChannelFuture#isSuccess() will return false. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.

newProgressivePromiseback to summary
public ChannelProgressivePromise newProgressivePromise()

Return an new ChannelProgressivePromise

newPromiseback to summary
public ChannelPromise newPromise()

Return a new ChannelPromise.

newSucceededFutureback to summary
public ChannelFuture newSucceededFuture()

Create a new ChannelFuture which is marked as succeeded already. So ChannelFuture#isSuccess() will return true. All FutureListener added to it will be notified directly. Also every call of blocking methods will just return without blocking.

readback to summary
public ChannelOutboundInvoker read()

Request to Read data from the Channel into the first inbound buffer, triggers an ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) event if data was read, and triggers a channelReadComplete 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 next ChannelOutboundHandler contained in the ChannelPipeline of the Channel.

voidPromiseback to summary
public ChannelPromise voidPromise()

Return a special ChannelPromise which can be reused for different operations.

It's only supported to use it for ChannelOutboundInvoker#write(Object, ChannelPromise).

Be aware that the returned 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 call ChannelPipeline#fireExceptionCaught(Throwable) in this case.

Be aware this is an expert feature and should be used with care!
writeback to summary
public ChannelFuture write(Object msg)

Request to write a message via this ChannelHandlerContext through the ChannelPipeline. This method will not request to actual flush, so be sure to call flush() once you want to request to flush all pending data to the actual transport.

writeback to summary
public ChannelFuture write(Object msg, ChannelPromise promise)

Request to write a message via this ChannelHandlerContext through the ChannelPipeline. This method will not request to actual flush, so be sure to call flush() once you want to request to flush all pending data to the actual transport.

writeAndFlushback to summary
public ChannelFuture writeAndFlush(Object msg, ChannelPromise promise)

Shortcut for call write(Object, ChannelPromise) and flush().

writeAndFlushback to summary
public ChannelFuture writeAndFlush(Object msg)

Shortcut for call write(Object) and flush().