Get rid of AbstractServiceDescriptor as it is no longer useful
diff --git a/compiler/src/test/golden/TestService.java.txt b/compiler/src/test/golden/TestService.java.txt
index 78c11c1..dcf1d83 100644
--- a/compiler/src/test/golden/TestService.java.txt
+++ b/compiler/src/test/golden/TestService.java.txt
@@ -23,7 +23,6 @@
"grpc.testing.TestService", "UnaryCall",
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.SimpleResponse.parser()));
- // Static method descriptors that strictly reflect the proto.
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -31,7 +30,6 @@
"grpc.testing.TestService", "StreamingOutputCall",
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
- // Static method descriptors that strictly reflect the proto.
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
io.grpc.testing.integration.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
io.grpc.MethodDescriptor.create(
@@ -39,7 +37,6 @@
"grpc.testing.TestService", "StreamingInputCall",
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingInputCallResponse.parser()));
- // Static method descriptors that strictly reflect the proto.
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_FULL_DUPLEX_CALL =
io.grpc.MethodDescriptor.create(
@@ -47,7 +44,6 @@
"grpc.testing.TestService", "FullDuplexCall",
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallRequest.parser()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
- // Static method descriptors that strictly reflect the proto.
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
io.grpc.testing.integration.Test.StreamingOutputCallResponse> METHOD_HALF_DUPLEX_CALL =
io.grpc.MethodDescriptor.create(
@@ -57,80 +53,17 @@
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.testing.integration.Test.StreamingOutputCallResponse.parser()));
public static TestServiceStub newStub(io.grpc.Channel channel) {
- return new TestServiceStub(channel, CONFIG);
+ return new TestServiceStub(channel);
}
public static TestServiceBlockingStub newBlockingStub(
io.grpc.Channel channel) {
- return new TestServiceBlockingStub(channel, CONFIG);
+ return new TestServiceBlockingStub(channel);
}
public static TestServiceFutureStub newFutureStub(
io.grpc.Channel channel) {
- return new TestServiceFutureStub(channel, CONFIG);
- }
-
- // The default service descriptor
- private static final TestServiceServiceDescriptor CONFIG =
- new TestServiceServiceDescriptor();
-
- @javax.annotation.concurrent.Immutable
- public static class TestServiceServiceDescriptor extends
- io.grpc.stub.AbstractServiceDescriptor<TestServiceServiceDescriptor> {
- public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
- io.grpc.testing.integration.Test.SimpleResponse> unaryCall;
- public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall;
- public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
- io.grpc.testing.integration.Test.StreamingInputCallResponse> streamingInputCall;
- public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse> fullDuplexCall;
- public final io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse> halfDuplexCall;
-
- private TestServiceServiceDescriptor() {
- unaryCall = METHOD_UNARY_CALL;
- streamingOutputCall = METHOD_STREAMING_OUTPUT_CALL;
- streamingInputCall = METHOD_STREAMING_INPUT_CALL;
- fullDuplexCall = METHOD_FULL_DUPLEX_CALL;
- halfDuplexCall = METHOD_HALF_DUPLEX_CALL;
- }
-
- @SuppressWarnings("unchecked")
- private TestServiceServiceDescriptor(
- java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
- unaryCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.SimpleRequest,
- io.grpc.testing.integration.Test.SimpleResponse>) methodMap.get(
- CONFIG.unaryCall.getFullMethodName());
- streamingOutputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
- CONFIG.streamingOutputCall.getFullMethodName());
- streamingInputCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingInputCallRequest,
- io.grpc.testing.integration.Test.StreamingInputCallResponse>) methodMap.get(
- CONFIG.streamingInputCall.getFullMethodName());
- fullDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
- CONFIG.fullDuplexCall.getFullMethodName());
- halfDuplexCall = (io.grpc.MethodDescriptor<io.grpc.testing.integration.Test.StreamingOutputCallRequest,
- io.grpc.testing.integration.Test.StreamingOutputCallResponse>) methodMap.get(
- CONFIG.halfDuplexCall.getFullMethodName());
- }
-
- @java.lang.Override
- protected TestServiceServiceDescriptor build(
- java.util.Map<java.lang.String, io.grpc.MethodDescriptor<?, ?>> methodMap) {
- return new TestServiceServiceDescriptor(methodMap);
- }
-
- @java.lang.Override
- public java.util.Collection<io.grpc.MethodDescriptor<?, ?>> methods() {
- return com.google.common.collect.ImmutableList.<io.grpc.MethodDescriptor<?, ?>>of(
- unaryCall,
- streamingOutputCall,
- streamingInputCall,
- fullDuplexCall,
- halfDuplexCall);
- }
+ return new TestServiceFutureStub(channel);
}
public static interface TestService {
@@ -165,124 +98,112 @@
io.grpc.testing.integration.Test.SimpleRequest request);
}
- public static class TestServiceStub extends
- io.grpc.stub.AbstractStub<TestServiceStub, TestServiceServiceDescriptor>
+ public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
implements TestService {
- private TestServiceStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config) {
- super(channel, config);
+ private TestServiceStub(io.grpc.Channel channel) {
+ super(channel);
}
private TestServiceStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- super(channel, config, callOptions);
+ super(channel, callOptions);
}
@java.lang.Override
protected TestServiceStub build(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- return new TestServiceStub(channel, config, callOptions);
+ return new TestServiceStub(channel, callOptions);
}
@java.lang.Override
public void unaryCall(io.grpc.testing.integration.Test.SimpleRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.SimpleResponse> responseObserver) {
asyncUnaryCall(
- channel.newCall(config.unaryCall, callOptions), request, responseObserver);
+ channel.newCall(METHOD_UNARY_CALL, callOptions), request, responseObserver);
}
@java.lang.Override
public void streamingOutputCall(io.grpc.testing.integration.Test.StreamingOutputCallRequest request,
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
asyncServerStreamingCall(
- channel.newCall(config.streamingOutputCall, callOptions), request, responseObserver);
+ channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request, responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallRequest> streamingInputCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingInputCallResponse> responseObserver) {
return asyncClientStreamingCall(
- channel.newCall(config.streamingInputCall, callOptions), responseObserver);
+ channel.newCall(METHOD_STREAMING_INPUT_CALL, callOptions), responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> fullDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return asyncDuplexStreamingCall(
- channel.newCall(config.fullDuplexCall, callOptions), responseObserver);
+ channel.newCall(METHOD_FULL_DUPLEX_CALL, callOptions), responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallRequest> halfDuplexCall(
io.grpc.stub.StreamObserver<io.grpc.testing.integration.Test.StreamingOutputCallResponse> responseObserver) {
return asyncDuplexStreamingCall(
- channel.newCall(config.halfDuplexCall, callOptions), responseObserver);
+ channel.newCall(METHOD_HALF_DUPLEX_CALL, callOptions), responseObserver);
}
}
- public static class TestServiceBlockingStub extends
- io.grpc.stub.AbstractStub<TestServiceBlockingStub, TestServiceServiceDescriptor>
+ public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
implements TestServiceBlockingClient {
- private TestServiceBlockingStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config) {
- super(channel, config);
+ private TestServiceBlockingStub(io.grpc.Channel channel) {
+ super(channel);
}
private TestServiceBlockingStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- super(channel, config, callOptions);
+ super(channel, callOptions);
}
@java.lang.Override
protected TestServiceBlockingStub build(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- return new TestServiceBlockingStub(channel, config, callOptions);
+ return new TestServiceBlockingStub(channel, callOptions);
}
@java.lang.Override
public io.grpc.testing.integration.Test.SimpleResponse unaryCall(io.grpc.testing.integration.Test.SimpleRequest request) {
return blockingUnaryCall(
- channel.newCall(config.unaryCall, callOptions), request);
+ channel.newCall(METHOD_UNARY_CALL, callOptions), request);
}
@java.lang.Override
public java.util.Iterator<io.grpc.testing.integration.Test.StreamingOutputCallResponse> streamingOutputCall(
io.grpc.testing.integration.Test.StreamingOutputCallRequest request) {
return blockingServerStreamingCall(
- channel.newCall(config.streamingOutputCall, callOptions), request);
+ channel.newCall(METHOD_STREAMING_OUTPUT_CALL, callOptions), request);
}
}
- public static class TestServiceFutureStub extends
- io.grpc.stub.AbstractStub<TestServiceFutureStub, TestServiceServiceDescriptor>
+ public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
implements TestServiceFutureClient {
- private TestServiceFutureStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config) {
- super(channel, config);
+ private TestServiceFutureStub(io.grpc.Channel channel) {
+ super(channel);
}
private TestServiceFutureStub(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- super(channel, config, callOptions);
+ super(channel, callOptions);
}
@java.lang.Override
protected TestServiceFutureStub build(io.grpc.Channel channel,
- TestServiceServiceDescriptor config,
io.grpc.CallOptions callOptions) {
- return new TestServiceFutureStub(channel, config, callOptions);
+ return new TestServiceFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.Test.SimpleResponse> unaryCall(
io.grpc.testing.integration.Test.SimpleRequest request) {
return futureUnaryCall(
- channel.newCall(config.unaryCall, callOptions), request);
+ channel.newCall(METHOD_UNARY_CALL, callOptions), request);
}
}