Member reordering
This commit is contained in:
parent
ef5fc808a2
commit
f3e910bd46
@ -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<ChannelFuture> futureQueue;
|
||||
|
||||
ConnectionlessBinder(SocketAddress localAddress, BlockingQueue<ChannelFuture> 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<ChannelFuture> futureQueue;
|
||||
|
||||
ConnectionlessBinder(SocketAddress localAddress, BlockingQueue<ChannelFuture> 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user