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

View File

@ -15,12 +15,22 @@
*/ */
package org.jboss.netty.channel; 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}. * Creates a new {@link ChannelPipeline} for a new {@link Channel}.
* <p> * <p>
* This interface was introduced to initialize the {@link ChannelPipeline} of * When a {@linkplain ServerChannel server-side channel} accepts a new incoming
* the child channel accepted by a {@link ServerChannel}, but it is safe to use * connection, a new child channel is created for each newly accepted connection.
* it for any other purposes. * 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://www.jboss.org/netty/">The Netty Project</a>
* @author <a href="http://gleamynode.net/">Trustin Lee</a> * @author <a href="http://gleamynode.net/">Trustin Lee</a>