diff --git a/src/main/java/org/jboss/netty/bootstrap/ConnectionlessBootstrap.java b/src/main/java/org/jboss/netty/bootstrap/ConnectionlessBootstrap.java index 1f4b8f64d2..5f5fc9eccd 100644 --- a/src/main/java/org/jboss/netty/bootstrap/ConnectionlessBootstrap.java +++ b/src/main/java/org/jboss/netty/bootstrap/ConnectionlessBootstrap.java @@ -226,41 +226,6 @@ public class ConnectionlessBootstrap extends Bootstrap { return channel; } - @ChannelPipelineCoverage("one") - private final class ConnectionlessBinder extends SimpleChannelUpstreamHandler { - - private final SocketAddress localAddress; - private final BlockingQueue futureQueue; - - ConnectionlessBinder(SocketAddress localAddress, BlockingQueue futureQueue) { - this.localAddress = localAddress; - this.futureQueue = futureQueue; - } - - @Override - public void channelOpen( - ChannelHandlerContext ctx, - ChannelStateEvent evt) { - evt.getChannel().getConfig().setPipelineFactory(getPipelineFactory()); - - // Apply options. - evt.getChannel().getConfig().setOptions(getOptions()); - - boolean finished = futureQueue.offer(evt.getChannel().bind(localAddress)); - assert finished; - ctx.sendUpstream(evt); - } - - @Override - public void exceptionCaught( - ChannelHandlerContext ctx, ExceptionEvent e) - throws Exception { - boolean finished = futureQueue.offer(failedFuture(e.getChannel(), e.getCause())); - assert finished; - ctx.sendUpstream(e); - } - } - /** * Creates a new connected channel with the current {@code "remoteAddress"} * and {@code "localAddress"} option. If the {@code "localAddress"} option @@ -371,4 +336,39 @@ public class ConnectionlessBootstrap extends Bootstrap { return future; } + + @ChannelPipelineCoverage("one") + private final class ConnectionlessBinder extends SimpleChannelUpstreamHandler { + + private final SocketAddress localAddress; + private final BlockingQueue futureQueue; + + ConnectionlessBinder(SocketAddress localAddress, BlockingQueue futureQueue) { + this.localAddress = localAddress; + this.futureQueue = futureQueue; + } + + @Override + public void channelOpen( + ChannelHandlerContext ctx, + ChannelStateEvent evt) { + evt.getChannel().getConfig().setPipelineFactory(getPipelineFactory()); + + // Apply options. + evt.getChannel().getConfig().setOptions(getOptions()); + + boolean finished = futureQueue.offer(evt.getChannel().bind(localAddress)); + assert finished; + ctx.sendUpstream(evt); + } + + @Override + public void exceptionCaught( + ChannelHandlerContext ctx, ExceptionEvent e) + throws Exception { + boolean finished = futureQueue.offer(failedFuture(e.getChannel(), e.getCause())); + assert finished; + ctx.sendUpstream(e); + } + } }