@@ -23,7 +23,6 @@ public class TestServiceGrpc {
2323 "grpc.testing.TestService" , "UnaryCall" ,
2424 io .grpc .protobuf .ProtoUtils .marshaller (io .grpc .testing .SimpleRequest .parser ()),
2525 io .grpc .protobuf .ProtoUtils .marshaller (io .grpc .testing .SimpleResponse .parser ()));
26- // Static method descriptors that strictly reflect the proto.
2726 public static final io .grpc .MethodDescriptor <io .grpc .testing .SimpleRequest ,
2827 io .grpc .testing .SimpleResponse > METHOD_STREAMING_CALL =
2928 io .grpc .MethodDescriptor .create (
@@ -33,59 +32,17 @@ public class TestServiceGrpc {
3332 io .grpc .protobuf .ProtoUtils .marshaller (io .grpc .testing .SimpleResponse .parser ()));
3433
3534 public static TestServiceStub newStub (io .grpc .Channel channel ) {
36- return new TestServiceStub (channel , CONFIG );
35+ return new TestServiceStub (channel );
3736 }
3837
3938 public static TestServiceBlockingStub newBlockingStub (
4039 io .grpc .Channel channel ) {
41- return new TestServiceBlockingStub (channel , CONFIG );
40+ return new TestServiceBlockingStub (channel );
4241 }
4342
4443 public static TestServiceFutureStub newFutureStub (
4544 io .grpc .Channel channel ) {
46- return new TestServiceFutureStub (channel , CONFIG );
47- }
48-
49- // The default service descriptor
50- private static final TestServiceServiceDescriptor CONFIG =
51- new TestServiceServiceDescriptor ();
52-
53- @ javax .annotation .concurrent .Immutable
54- public static class TestServiceServiceDescriptor extends
55- io .grpc .stub .AbstractServiceDescriptor <TestServiceServiceDescriptor > {
56- public final io .grpc .MethodDescriptor <io .grpc .testing .SimpleRequest ,
57- io .grpc .testing .SimpleResponse > unaryCall ;
58- public final io .grpc .MethodDescriptor <io .grpc .testing .SimpleRequest ,
59- io .grpc .testing .SimpleResponse > streamingCall ;
60-
61- private TestServiceServiceDescriptor () {
62- unaryCall = METHOD_UNARY_CALL ;
63- streamingCall = METHOD_STREAMING_CALL ;
64- }
65-
66- @ SuppressWarnings ("unchecked" )
67- private TestServiceServiceDescriptor (
68- java .util .Map <java .lang .String , io .grpc .MethodDescriptor <?, ?>> methodMap ) {
69- unaryCall = (io .grpc .MethodDescriptor <io .grpc .testing .SimpleRequest ,
70- io .grpc .testing .SimpleResponse >) methodMap .get (
71- CONFIG .unaryCall .getFullMethodName ());
72- streamingCall = (io .grpc .MethodDescriptor <io .grpc .testing .SimpleRequest ,
73- io .grpc .testing .SimpleResponse >) methodMap .get (
74- CONFIG .streamingCall .getFullMethodName ());
75- }
76-
77- @ java .lang .Override
78- protected TestServiceServiceDescriptor build (
79- java .util .Map <java .lang .String , io .grpc .MethodDescriptor <?, ?>> methodMap ) {
80- return new TestServiceServiceDescriptor (methodMap );
81- }
82-
83- @ java .lang .Override
84- public java .util .Collection <io .grpc .MethodDescriptor <?, ?>> methods () {
85- return com .google .common .collect .ImmutableList .<io .grpc .MethodDescriptor <?, ?>>of (
86- unaryCall ,
87- streamingCall );
88- }
45+ return new TestServiceFutureStub (channel );
8946 }
9047
9148 public static interface TestService {
@@ -108,96 +65,84 @@ public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.Simple
10865 io .grpc .testing .SimpleRequest request );
10966 }
11067
111- public static class TestServiceStub extends
112- io .grpc .stub .AbstractStub <TestServiceStub , TestServiceServiceDescriptor >
68+ public static class TestServiceStub extends io .grpc .stub .AbstractStub <TestServiceStub >
11369 implements TestService {
114- private TestServiceStub (io .grpc .Channel channel ,
115- TestServiceServiceDescriptor config ) {
116- super (channel , config );
70+ private TestServiceStub (io .grpc .Channel channel ) {
71+ super (channel );
11772 }
11873
11974 private TestServiceStub (io .grpc .Channel channel ,
120- TestServiceServiceDescriptor config ,
12175 io .grpc .CallOptions callOptions ) {
122- super (channel , config , callOptions );
76+ super (channel , callOptions );
12377 }
12478
12579 @ java .lang .Override
12680 protected TestServiceStub build (io .grpc .Channel channel ,
127- TestServiceServiceDescriptor config ,
12881 io .grpc .CallOptions callOptions ) {
129- return new TestServiceStub (channel , config , callOptions );
82+ return new TestServiceStub (channel , callOptions );
13083 }
13184
13285 @ java .lang .Override
13386 public void unaryCall (io .grpc .testing .SimpleRequest request ,
13487 io .grpc .stub .StreamObserver <io .grpc .testing .SimpleResponse > responseObserver ) {
13588 asyncUnaryCall (
136- channel .newCall (config . unaryCall , callOptions ), request , responseObserver );
89+ channel .newCall (METHOD_UNARY_CALL , callOptions ), request , responseObserver );
13790 }
13891
13992 @ java .lang .Override
14093 public io .grpc .stub .StreamObserver <io .grpc .testing .SimpleRequest > streamingCall (
14194 io .grpc .stub .StreamObserver <io .grpc .testing .SimpleResponse > responseObserver ) {
14295 return asyncDuplexStreamingCall (
143- channel .newCall (config . streamingCall , callOptions ), responseObserver );
96+ channel .newCall (METHOD_STREAMING_CALL , callOptions ), responseObserver );
14497 }
14598 }
14699
147- public static class TestServiceBlockingStub extends
148- io .grpc .stub .AbstractStub <TestServiceBlockingStub , TestServiceServiceDescriptor >
100+ public static class TestServiceBlockingStub extends io .grpc .stub .AbstractStub <TestServiceBlockingStub >
149101 implements TestServiceBlockingClient {
150- private TestServiceBlockingStub (io .grpc .Channel channel ,
151- TestServiceServiceDescriptor config ) {
152- super (channel , config );
102+ private TestServiceBlockingStub (io .grpc .Channel channel ) {
103+ super (channel );
153104 }
154105
155106 private TestServiceBlockingStub (io .grpc .Channel channel ,
156- TestServiceServiceDescriptor config ,
157107 io .grpc .CallOptions callOptions ) {
158- super (channel , config , callOptions );
108+ super (channel , callOptions );
159109 }
160110
161111 @ java .lang .Override
162112 protected TestServiceBlockingStub build (io .grpc .Channel channel ,
163- TestServiceServiceDescriptor config ,
164113 io .grpc .CallOptions callOptions ) {
165- return new TestServiceBlockingStub (channel , config , callOptions );
114+ return new TestServiceBlockingStub (channel , callOptions );
166115 }
167116
168117 @ java .lang .Override
169118 public io .grpc .testing .SimpleResponse unaryCall (io .grpc .testing .SimpleRequest request ) {
170119 return blockingUnaryCall (
171- channel .newCall (config . unaryCall , callOptions ), request );
120+ channel .newCall (METHOD_UNARY_CALL , callOptions ), request );
172121 }
173122 }
174123
175- public static class TestServiceFutureStub extends
176- io .grpc .stub .AbstractStub <TestServiceFutureStub , TestServiceServiceDescriptor >
124+ public static class TestServiceFutureStub extends io .grpc .stub .AbstractStub <TestServiceFutureStub >
177125 implements TestServiceFutureClient {
178- private TestServiceFutureStub (io .grpc .Channel channel ,
179- TestServiceServiceDescriptor config ) {
180- super (channel , config );
126+ private TestServiceFutureStub (io .grpc .Channel channel ) {
127+ super (channel );
181128 }
182129
183130 private TestServiceFutureStub (io .grpc .Channel channel ,
184- TestServiceServiceDescriptor config ,
185131 io .grpc .CallOptions callOptions ) {
186- super (channel , config , callOptions );
132+ super (channel , callOptions );
187133 }
188134
189135 @ java .lang .Override
190136 protected TestServiceFutureStub build (io .grpc .Channel channel ,
191- TestServiceServiceDescriptor config ,
192137 io .grpc .CallOptions callOptions ) {
193- return new TestServiceFutureStub (channel , config , callOptions );
138+ return new TestServiceFutureStub (channel , callOptions );
194139 }
195140
196141 @ java .lang .Override
197142 public com .google .common .util .concurrent .ListenableFuture <io .grpc .testing .SimpleResponse > unaryCall (
198143 io .grpc .testing .SimpleRequest request ) {
199144 return futureUnaryCall (
200- channel .newCall (config . unaryCall , callOptions ), request );
145+ channel .newCall (METHOD_UNARY_CALL , callOptions ), request );
201146 }
202147 }
203148
0 commit comments