diff --git a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java index 90e3fe4a39..02eea45c4e 100644 --- a/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java +++ b/src/main/java/org/jboss/netty/bootstrap/Bootstrap.java @@ -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) diff --git a/src/main/java/org/jboss/netty/channel/ChannelPipelineFactory.java b/src/main/java/org/jboss/netty/channel/ChannelPipelineFactory.java index ae7e3a33a0..6317782624 100644 --- a/src/main/java/org/jboss/netty/channel/ChannelPipelineFactory.java +++ b/src/main/java/org/jboss/netty/channel/ChannelPipelineFactory.java @@ -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}. *

- * 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. + *

+ * 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 The Netty Project * @author Trustin Lee