ChannelHandler to interact with its ChannelPipeline
and other handlers. Among other things a handler can notify the next ChannelHandler in the
ChannelPipeline as well as modify the ChannelPipeline it belongs to dynamically.
ChannelPipeline by calling one of the various methods
provided here.
Please refer to ChannelPipeline to understand how an event flows.
ChannelPipeline your handler belongs to by calling
pipeline(). A non-trivial application could insert, remove, or
replace handlers in the pipeline dynamically at runtime.
ChannelHandlerContext for later use, such as
triggering an event outside the handler methods, even from a different thread.
public class MyHandler extendsChannelHandler{ privateChannelHandlerContextctx; public void handlerAdded(ChannelHandlerContextctx) { this.ctx = ctx; } public void login(String username, password) { ctx.write(new LoginMessage(username, password)); } ... }
ChannelHandler instance can be added to more than
one ChannelPipeline. It means a single ChannelHandler
instance can have more than one ChannelHandlerContext and therefore
the single instance can be invoked with different
ChannelHandlerContexts if it is added to one or more
ChannelPipelines more than once.
Please refer to the ChannelHandler, and
ChannelPipeline to find out more about inbound and outbound operations,
what fundamental differences they have, how they flow in a pipeline, and how to handle
the operation in your application.
| bufferAllocator | back to summary |
|---|---|
| public default BufferAllocator bufferAllocator() Return the assigned | |
| channel | back to summary |
|---|---|
| public default Channel channel() Return the | |
| fireChannelActive | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelActive() Redeclares io. Doc from io. A
| |
| fireChannelExceptionCaught | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelExceptionCaught(Throwable cause) Redeclares io. Doc from io. A
| |
| fireChannelInactive | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelInactive() Redeclares io. Doc from io. A
| |
| fireChannelInboundEvent | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelInboundEvent(Object evt) Redeclares io. Doc from io. A
| |
| fireChannelRead | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelRead(Object msg) Redeclares io. Doc from io. A
| |
| fireChannelReadComplete | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelReadComplete() Redeclares io. Doc from io. Triggers an
| |
| fireChannelRegistered | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelRegistered() Redeclares io. Doc from io. A
| |
| fireChannelShutdown | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelShutdown(ChannelShutdownDirection direction) Redeclares io. Doc from io. A
| |
| fireChannelUnregistered | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelUnregistered() Redeclares io. Doc from io. A
| |
| fireChannelWritabilityChanged | back to summary |
|---|---|
| public ChannelHandlerContext fireChannelWritabilityChanged() Redeclares io. Doc from io. Triggers an
| |
| flush | back to summary |
|---|---|
| public ChannelHandlerContext flush() Redeclares io. Doc from io. Request to flush all pending messages via this ChannelOutboundInvoker.
| |
| handler | back to summary |
|---|---|
| public ChannelHandler handler() The | |
| isRemoved | back to summary |
|---|---|
| public boolean isRemoved() Return | |
| name | back to summary |
|---|---|
| public String name() The unique name of the | |
| pipeline | back to summary |
|---|---|
| public ChannelPipeline pipeline() Return the assigned | |
| read | back to summary |
|---|---|
| public ChannelHandlerContext read(ReadBufferAllocator readBufferAllocator) Redeclares io. Doc from io. Request to read data from the
This will result in having the
| |
| read | back to summary |
|---|---|
| public ChannelHandlerContext read() Redeclares io.
| |