public interface LifeCycleAwareChannelHandler extends ChannelHandler
ChannelHandler
that is notified when it is added to or removed
from a ChannelPipeline
.
ChannelHandlerContext
ChannelHandlerContext.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.Exception
void afterAdd(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception
void beforeRemove(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception
void afterRemove(ChannelHandlerContext ctx) throws java.lang.Exception
java.lang.Exception