public interface LifeCycleAwareChannelHandler extends ChannelHandler
ChannelHandler that is notified when it is added to or removed
from a ChannelPipeline.
ChannelHandlerContextChannelHandlerContext.sendUpstream(ChannelEvent) or
ChannelHandlerContext.sendDownstream(ChannelEvent) in
beforeAdd(ChannelHandlerContext) or afterRemove(ChannelHandlerContext)
might lead to an unexpected behavior. It is because the context object
might not have been fully added to the pipeline or the context object is not
a part of the pipeline anymore respectively.ChannelHandler.Sharable| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterAdd(ChannelHandlerContext ctx) |
void |
afterRemove(ChannelHandlerContext ctx) |
void |
beforeAdd(ChannelHandlerContext ctx) |
void |
beforeRemove(ChannelHandlerContext ctx) |
void beforeAdd(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exceptionvoid afterAdd(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exceptionvoid beforeRemove(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exceptionvoid afterRemove(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception