Migrating to Netty 4.1

Fixes #164
This commit is contained in:
nmittler 2015-03-11 12:15:30 -07:00
parent 54be11ef3c
commit 2a425090d1
6 changed files with 7 additions and 16 deletions

View File

@ -39,7 +39,7 @@ subprojects {
// TODO: Unreleased dependencies. // TODO: Unreleased dependencies.
// These must already be installed in the local maven repository. // These must already be installed in the local maven repository.
netty: 'io.netty:netty-codec-http2:5.0.0.Alpha3-SNAPSHOT', netty: 'io.netty:netty-codec-http2:4.1.0.Beta5-SNAPSHOT',
// Test dependencies. // Test dependencies.
junit: 'junit:junit:4.11', junit: 'junit:junit:4.11',

View File

@ -125,7 +125,6 @@ public abstract class AbstractClientStream<IdT> extends AbstractStream<IdT>
* Processes the contents of a received data frame from the server. * Processes the contents of a received data frame from the server.
* *
* @param frame the received data frame. Its ownership is transferred to this method. * @param frame the received data frame. Its ownership is transferred to this method.
* @param
*/ */
protected void inboundDataReceived(Buffer frame) { protected void inboundDataReceived(Buffer frame) {
Preconditions.checkNotNull(frame, "frame"); Preconditions.checkNotNull(frame, "frame");

View File

@ -191,7 +191,7 @@ public final class HttpUtil {
/** /**
* Looks up the {@link Status} from the given HTTP/2 error code. * Looks up the {@link Status} from the given HTTP/2 error code.
* *
* @param errorCode the HTTP/2 error code. * @param code the HTTP/2 error code.
* @return a {@link Status} representing the given error. * @return a {@link Status} representing the given error.
*/ */
public static Status statusForCode(int code) { public static Status statusForCode(int code) {

@ -1 +1 @@
Subproject commit 44ee2cac433a6f8640d01a70e8b90b70852aeeae Subproject commit 3df7b4dac746c2af2d65528bf85495eb530aba41

View File

@ -37,8 +37,8 @@ import com.google.common.util.concurrent.SettableFuture;
import io.netty.channel.Channel; import io.netty.channel.Channel;
import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerAdapter;
import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelInitializer;
import io.netty.handler.codec.http.DefaultHttpRequest; import io.netty.handler.codec.http.DefaultHttpRequest;
import io.netty.handler.codec.http.HttpClientCodec; import io.netty.handler.codec.http.HttpClientCodec;
@ -229,7 +229,7 @@ public class Http2Negotiator {
/** /**
* Report protocol upgrade completion using a promise. * Report protocol upgrade completion using a promise.
*/ */
private static class UpgradeCompletionHandler extends ChannelHandlerAdapter { private static class UpgradeCompletionHandler extends ChannelInboundHandlerAdapter {
private final SettableFuture<Void> upgradeFuture = SettableFuture.create(); private final SettableFuture<Void> upgradeFuture = SettableFuture.create();
public ListenableFuture<Void> getUpgradeFuture() { public ListenableFuture<Void> getUpgradeFuture() {

View File

@ -45,12 +45,9 @@ import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.handler.codec.AsciiString; import io.netty.handler.codec.AsciiString;
import io.netty.handler.codec.http2.DefaultHttp2Headers; import io.netty.handler.codec.http2.DefaultHttp2Headers;
import io.netty.handler.codec.http2.Http2Headers; import io.netty.handler.codec.http2.Http2Headers;
import io.netty.util.concurrent.ExecutorServiceFactory;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/** /**
* Common utility methods. * Common utility methods.
@ -177,13 +174,8 @@ class Utils {
@Override @Override
public EventLoopGroup create() { public EventLoopGroup create() {
return new NioEventLoopGroup(0, new ExecutorServiceFactory() { return new NioEventLoopGroup(0, new ThreadFactoryBuilder().setNameFormat(name + "-%d")
@Override .build());
public ExecutorService newExecutorService(int parallelism) {
return Executors.newFixedThreadPool(parallelism, new ThreadFactoryBuilder()
.setNameFormat(name + "-%d").build());
}
});
} }
@Override @Override