import static org.opendaylight.netconf.transport.http.Http2Utils.copyStreamId;
import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
import io.netty.buffer.Unpooled;
import io.netty.channel.Channel;
private final RequestDispatcher dispatcher;
ServerChannelInitializer(final HttpServerGrouping httpParams, final RequestDispatcher dispatcher) {
- super();
authHandler = BasicAuthHandler.ofNullable(httpParams);
this.dispatcher = dispatcher;
}
return new SimpleChannelInboundHandler<FullHttpRequest>() {
@Override
protected void channelRead0(final ChannelHandlerContext ctx, final FullHttpRequest request) {
- Futures.addCallback(dispatcher.dispatch(request.retain()), new FutureCallback<>() {
+ dispatcher.dispatch(request.retain(), new FutureCallback<>() {
@Override
public void onSuccess(final FullHttpResponse response) {
copyStreamId(request, response);
.setInt(CONTENT_LENGTH, response.content().readableBytes());
onSuccess(response);
}
- }, MoreExecutors.directExecutor());
+ });
}
};
}