More explanation on how ChannelPipelineFactory works

This commit is contained in:
Trustin Lee 2010-02-09 03:56:29 +00:00
parent 0857f398e0
commit 739e656963
2 changed files with 18 additions and 8 deletions

View File

@ -229,7 +229,7 @@ public class Bootstrap implements ExternalResourceReleasable {
/**
* Returns the {@link ChannelPipelineFactory} which creates a new
* {@link ChannelPipeline} for a new {@link Channel}.
* {@link ChannelPipeline} for each new {@link Channel}.
*
* @see #getPipeline()
*/
@ -239,10 +239,10 @@ public class Bootstrap implements ExternalResourceReleasable {
/**
* Sets the {@link ChannelPipelineFactory} which creates a new
* {@link ChannelPipeline} for a new {@link Channel}. Calling this method
* invalidates the current {@code pipeline} property of this bootstrap.
* Subsequent {@link #getPipeline()} and {@link #getPipelineAsMap()} calls
* will raise {@link IllegalStateException}.
* {@link ChannelPipeline} for each new {@link Channel}. Calling this
* method invalidates the current {@code pipeline} property of this
* bootstrap. Subsequent {@link #getPipeline()} and {@link #getPipelineAsMap()}
* calls will raise {@link IllegalStateException}.
*
* @see #setPipeline(ChannelPipeline)
* @see #setPipelineAsMap(Map)

View File

@ -15,12 +15,22 @@
*/
package org.jboss.netty.channel;
import org.jboss.netty.bootstrap.Bootstrap;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
/**
* Creates a new {@link ChannelPipeline} for a new {@link Channel}.
* <p>
* This interface was introduced to initialize the {@link ChannelPipeline} of
* the child channel accepted by a {@link ServerChannel}, but it is safe to use
* it for any other purposes.
* When a {@linkplain ServerChannel server-side channel} accepts a new incoming
* connection, a new child channel is created for each newly accepted connection.
* A new child channel uses a new {@link ChannelPipeline}, which is created by
* the {@link ChannelPipelineFactory} specified in the server-side channel's
* {@link ChannelConfig#getPipelineFactory() "pipelineFactory"} option.
* <p>
* Also, when a {@link ClientBootstrap} or {@link ConnectionlessBootstrap}
* creates a new channel, it uses the {@link Bootstrap#getPipelineFactory() "pipelineFactory"}
* property to create a new {@link ChannelPipeline} for each new channel.
*
* @author <a href="http://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a>