Improved documentation of LifeCycleAwareChannelHandler
This commit is contained in:
parent
70c41e53cc
commit
945d2ea3cd
@ -31,10 +31,9 @@ package org.jboss.netty.channel;
|
|||||||
* {@linkplain ChannelPipeline#attach(Channel, ChannelSink) attached}.
|
* {@linkplain ChannelPipeline#attach(Channel, ChannelSink) attached}.
|
||||||
* That is, if you add a {@link LifeCycleAwareChannelHandler} to the unattached
|
* That is, if you add a {@link LifeCycleAwareChannelHandler} to the unattached
|
||||||
* {@link ChannelPipeline}, the life cycle handler methods in this handler will
|
* {@link ChannelPipeline}, the life cycle handler methods in this handler will
|
||||||
* not be invoked because there's no associated {@link Channel} and
|
* not be invoked because there's no associated {@link ChannelHandlerContext}:
|
||||||
* {@link ChannelHandlerContext} with the handler:
|
|
||||||
* <pre>
|
* <pre>
|
||||||
* // Create a new unattached pipeline
|
* // Create a new pipeline which is unattached initially.
|
||||||
* ChannelPipeline pipeline = Channels.pipeline();
|
* ChannelPipeline pipeline = Channels.pipeline();
|
||||||
* // beforeAdd() and afterAdd() will not be called.
|
* // beforeAdd() and afterAdd() will not be called.
|
||||||
* pipeline.addLast("handler", new MyLifeCycleAwareChannelHandler());
|
* pipeline.addLast("handler", new MyLifeCycleAwareChannelHandler());
|
||||||
@ -43,7 +42,7 @@ package org.jboss.netty.channel;
|
|||||||
* </pre>
|
* </pre>
|
||||||
* However, once the {@link ChannelPipeline} is attached and the
|
* However, once the {@link ChannelPipeline} is attached and the
|
||||||
* {@code channelOpen} event is fired, the life cycle handler methods will
|
* {@code channelOpen} event is fired, the life cycle handler methods will
|
||||||
* be invoked on addition of removal:
|
* be invoked on addition or removal:
|
||||||
* <pre>
|
* <pre>
|
||||||
* public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) {
|
* public void channelOpen(ChannelHandlerContext ctx, ChannelStateEvent evt) {
|
||||||
* // channelOpen event has been triggered, which means the pipeline has
|
* // channelOpen event has been triggered, which means the pipeline has
|
||||||
|
Loading…
x
Reference in New Issue
Block a user