Fixed issue: NETTY-331 (Regression NETTY-262: Server bootstrap bound channel pipeline has become immutable)

* ServerBootstrap now always uses the default pipeline instead of the static one
This commit is contained in:
Trustin Lee 2010-07-07 07:55:37 +00:00
parent 1c6813a06d
commit e36d2dc3de

View File

@ -41,7 +41,6 @@ import org.jboss.netty.channel.ChildChannelStateEvent;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.ServerChannelFactory;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.StaticChannelPipeline;
/**
* A helper class which creates a new server-side {@link Channel} and accepts
@ -271,15 +270,13 @@ public class ServerBootstrap extends Bootstrap {
final BlockingQueue<ChannelFuture> futureQueue =
new LinkedBlockingQueue<ChannelFuture>();
ChannelPipeline bossPipeline;
ChannelHandler binder = new Binder(localAddress, futureQueue);
ChannelHandler parentHandler = getParentHandler();
if (parentHandler != null) {
bossPipeline = pipeline();
ChannelPipeline bossPipeline = pipeline();
bossPipeline.addLast("binder", binder);
if (parentHandler != null) {
bossPipeline.addLast("userHandler", parentHandler);
} else {
bossPipeline = new StaticChannelPipeline(binder);
}
Channel channel = getFactory().newChannel(bossPipeline);