
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| Modifier and Type | Method and Description |
|---|---|
void |
afterAdd(ChannelHandlerContext ctx) |
void |
afterRemove(ChannelHandlerContext ctx) |
void |
beforeAdd(ChannelHandlerContext ctx) |
void |
beforeRemove(ChannelHandlerContext ctx) |
void beforeAdd(ChannelHandlerContext ctx) throws Exception
Exceptionvoid afterAdd(ChannelHandlerContext ctx) throws Exception
Exceptionvoid beforeRemove(ChannelHandlerContext ctx) throws Exception
Exceptionvoid afterRemove(ChannelHandlerContext ctx) throws Exception
ExceptionCopyright © 2008-2014 The Netty Project. All Rights Reserved.