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
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
Exception
void afterAdd(ChannelHandlerContext ctx) throws Exception
Exception
void beforeRemove(ChannelHandlerContext ctx) throws Exception
Exception
void afterRemove(ChannelHandlerContext ctx) throws Exception
Exception
Copyright © 2008-2015 The Netty Project. All Rights Reserved.