From 9f7ed98b17883f775a8e1d5122c6040e7cc9a86b Mon Sep 17 00:00:00 2001 From: Paulo Lopes Date: Thu, 31 Aug 2017 11:11:55 +0200 Subject: [PATCH] Upgrade to 1.6.1 --- pom.xml | 13 +++++-------- src/main/asciidoc/java/index.adoc | 4 ++-- src/main/java/examples/GreeterGrpc.java | 19 +++++++++++-------- src/main/java/examples/HelloReply.java | 11 +++++++++++ src/main/java/examples/HelloRequest.java | 11 +++++++++++ src/main/java/io/vertx/grpc/VertxServer.java | 3 +-- 6 files changed, 41 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index bc620aa2..7b9b578a 100644 --- a/pom.xml +++ b/pom.xml @@ -30,10 +30,7 @@ 3.5.0-SNAPSHOT - 1.3.0 - - 1.3.0 - + 1.6.1 2.0.6 ${settings.localRepository}/org/mortbay/jetty/alpn/jetty-alpn-agent/${jetty.alpnAgent.version}/jetty-alpn-agent-${jetty.alpnAgent.version}.jar @@ -70,17 +67,17 @@ io.grpc grpc-netty - ${grpc.version} + ${vertx.grpc.version} io.grpc grpc-protobuf - ${grpc.version} + ${vertx.grpc.version} io.grpc grpc-stub - ${grpc.version} + ${vertx.grpc.version} @@ -166,7 +163,7 @@ protobuf-java directly, you will be transitively depending on the protobuf-java version that grpc depends on. --> - com.google.protobuf:protoc:3.2.0:exe:${os.detected.classifier} + com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier} grpc-java io.vertx:protoc-gen-grpc-java:${vertx.grpc.version}:exe:${os.detected.classifier} diff --git a/src/main/asciidoc/java/index.adoc b/src/main/asciidoc/java/index.adoc index 8780f6f4..66131d7f 100644 --- a/src/main/asciidoc/java/index.adoc +++ b/src/main/asciidoc/java/index.adoc @@ -82,7 +82,7 @@ If you're using Apache Maven you need to add the plugin: com.google.protobuf:protoc:3.2.0:exe:${os.detected.classifier} grpc-java - io.vertx:protoc-gen-grpc-java:1.3.0:${os.detected.classifier} + io.vertx:protoc-gen-grpc-java:1.6.1:${os.detected.classifier} @@ -149,7 +149,7 @@ protobuf { } plugins { grpc { - artifact = "io.vertx:protoc-gen-grpc-java:1.3.0" + artifact = "io.vertx:protoc-gen-grpc-java:1.6.1" } } generateProtoTasks { diff --git a/src/main/java/examples/GreeterGrpc.java b/src/main/java/examples/GreeterGrpc.java index 3976fb6b..fbcbdc8f 100644 --- a/src/main/java/examples/GreeterGrpc.java +++ b/src/main/java/examples/GreeterGrpc.java @@ -21,7 +21,7 @@ * */ @javax.annotation.Generated( - value = "by gRPC proto compiler (version 1.3.0)", + value = "by gRPC proto compiler (version 1.6.1)", comments = "Source: helloworld.proto") public final class GreeterGrpc { @@ -62,12 +62,15 @@ public void onCompleted() { @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") public static final io.grpc.MethodDescriptor METHOD_SAY_HELLO = - io.grpc.MethodDescriptor.create( - io.grpc.MethodDescriptor.MethodType.UNARY, - generateFullMethodName( - "helloworld.Greeter", "SayHello"), - io.grpc.protobuf.ProtoUtils.marshaller(examples.HelloRequest.getDefaultInstance()), - io.grpc.protobuf.ProtoUtils.marshaller(examples.HelloReply.getDefaultInstance())); + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName( + "helloworld.Greeter", "SayHello")) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + examples.HelloRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + examples.HelloReply.getDefaultInstance())) + .build(); /** * Creates a new async stub that supports all call types for the service @@ -85,7 +88,7 @@ public static GreeterBlockingStub newBlockingStub( } /** - * Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service + * Creates a new ListenableFuture-style stub that supports unary calls on the service */ public static GreeterFutureStub newFutureStub( io.grpc.Channel channel) { diff --git a/src/main/java/examples/HelloReply.java b/src/main/java/examples/HelloReply.java index 2001d0e8..e39c3a40 100644 --- a/src/main/java/examples/HelloReply.java +++ b/src/main/java/examples/HelloReply.java @@ -170,6 +170,17 @@ public int hashCode() { return hash; } + public static examples.HelloReply parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static examples.HelloReply parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static examples.HelloReply parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { diff --git a/src/main/java/examples/HelloRequest.java b/src/main/java/examples/HelloRequest.java index bf5572af..59367045 100644 --- a/src/main/java/examples/HelloRequest.java +++ b/src/main/java/examples/HelloRequest.java @@ -170,6 +170,17 @@ public int hashCode() { return hash; } + public static examples.HelloRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static examples.HelloRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static examples.HelloRequest parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { diff --git a/src/main/java/io/vertx/grpc/VertxServer.java b/src/main/java/io/vertx/grpc/VertxServer.java index a223f095..474b1186 100644 --- a/src/main/java/io/vertx/grpc/VertxServer.java +++ b/src/main/java/io/vertx/grpc/VertxServer.java @@ -1,7 +1,6 @@ package io.vertx.grpc; import io.grpc.Server; -import io.grpc.internal.ServerImpl; import io.grpc.netty.NettyServerBuilder; import io.netty.handler.ssl.SslContext; import io.vertx.core.AsyncResult; @@ -41,7 +40,7 @@ private static class ActualServer { final AtomicInteger count = new AtomicInteger(); final VertxEventLoopGroup group = new VertxEventLoopGroup(); final HandlerManager manager = new HandlerManager<>(group); - final ServerImpl server; + final Server server; final ThreadLocal> contextLocal = new ThreadLocal<>(); private ActualServer(Vertx vertx, ServerID id, HttpServerOptions options, NettyServerBuilder builder) {