diff --git a/src/main/java/org/jboss/netty/channel/LifeCycleAwareChannelHandler.java b/src/main/java/org/jboss/netty/channel/LifeCycleAwareChannelHandler.java index 451a080bb4..83dfb20f35 100644 --- a/src/main/java/org/jboss/netty/channel/LifeCycleAwareChannelHandler.java +++ b/src/main/java/org/jboss/netty/channel/LifeCycleAwareChannelHandler.java @@ -18,40 +18,6 @@ package org.jboss.netty.channel; /** * A {@link ChannelHandler} that is notified when it is added to or removed * from a {@link ChannelPipeline}. - *
- * Please note that the methods of this handler is called only when the - * {@link ChannelPipeline} it belongs to has been - * {@linkplain ChannelPipeline#attach(Channel, ChannelSink) attached}. - * That is, if you add a {@link LifeCycleAwareChannelHandler} to the unattached - * {@link ChannelPipeline}, the life cycle handler methods in this handler will - * not be invoked because there's no associated {@link ChannelHandlerContext}: - *
- * // Create a new pipeline which is unattached initially. - * ChannelPipeline pipeline = Channels.pipeline(); - * // beforeAdd() and afterAdd() will not be called. - * pipeline.addLast("handler", new MyLifeCycleAwareChannelHandler()); - * // beforeRemove() and afterRemove() will not be called. - * pipeline.remove("handler"); - *- * However, once the {@link ChannelPipeline} is attached and the - * {@code channelOpen} event is fired, the life cycle handler methods will - * be invoked on addition or removal: - *
- * public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) { - * // channelOpen event has been triggered, which means the pipeline has - * // been attached to the channel. - * ChannelPipeline pipeline = ctx.getChannel().getPipeline(); - * // beforeAdd() and afterAdd() will be called. - * pipeline.addLast("handler", new MyLifeCycleAwareChannelHandler()); - * } - * - * public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent evt) { - * // Once attached, the pipeline is never detached. - * ChannelPipeline pipeline = ctx.getChannel().getPipeline(); - * // beforeRemove() and afterRemove() will be called. - * pipeline.remove("handler"); - * } - ** * @author The Netty Project (netty-dev@lists.jboss.org) * @author Trustin Lee (trustin@gmail.com)