77 * The greeting service definition.
88 * </pre>
99 */
10- @ javax .annotation .Generated (
11- value = "by gRPC proto compiler (version 1.51.0)" ,
12- comments = "Source: helloworld.proto" )
1310@ io .grpc .stub .annotations .GrpcGenerated
1411public final class SimpleGrpc {
1512
1613 private SimpleGrpc () {}
1714
18- public static final String SERVICE_NAME = "Simple" ;
15+ public static final java . lang . String SERVICE_NAME = "Simple" ;
1916
2017 // Static method descriptors that strictly reflect the proto.
2118 private static volatile io .grpc .MethodDescriptor <grpc .HelloRequest ,
@@ -63,6 +60,21 @@ public SimpleStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptio
6360 return SimpleStub .newStub (factory , channel );
6461 }
6562
63+ /**
64+ * Creates a new blocking-style stub that supports all types of calls on the service
65+ */
66+ public static SimpleBlockingV2Stub newBlockingV2Stub (
67+ io .grpc .Channel channel ) {
68+ io .grpc .stub .AbstractStub .StubFactory <SimpleBlockingV2Stub > factory =
69+ new io .grpc .stub .AbstractStub .StubFactory <SimpleBlockingV2Stub >() {
70+ @ java .lang .Override
71+ public SimpleBlockingV2Stub newStub (io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
72+ return new SimpleBlockingV2Stub (channel , callOptions );
73+ }
74+ };
75+ return SimpleBlockingV2Stub .newStub (factory , channel );
76+ }
77+
6678 /**
6779 * Creates a new blocking-style stub that supports unary and streaming output calls on the service
6880 */
@@ -98,37 +110,41 @@ public SimpleFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions cal
98110 * The greeting service definition.
99111 * </pre>
100112 */
101- public static abstract class SimpleImplBase implements io . grpc . BindableService {
113+ public interface AsyncService {
102114
103115 /**
104116 * <pre>
105117 * Sends a greeting
106118 * </pre>
107119 */
108- public void sayHello (grpc .HelloRequest request ,
120+ default void sayHello (grpc .HelloRequest request ,
109121 io .grpc .stub .StreamObserver <grpc .HelloReply > responseObserver ) {
110122 io .grpc .stub .ServerCalls .asyncUnimplementedUnaryCall (getSayHelloMethod (), responseObserver );
111123 }
124+ }
125+
126+ /**
127+ * Base class for the server implementation of the service Simple.
128+ * <pre>
129+ * The greeting service definition.
130+ * </pre>
131+ */
132+ public static abstract class SimpleImplBase
133+ implements io .grpc .BindableService , AsyncService {
112134
113135 @ java .lang .Override public final io .grpc .ServerServiceDefinition bindService () {
114- return io .grpc .ServerServiceDefinition .builder (getServiceDescriptor ())
115- .addMethod (
116- getSayHelloMethod (),
117- io .grpc .stub .ServerCalls .asyncUnaryCall (
118- new MethodHandlers <
119- grpc .HelloRequest ,
120- grpc .HelloReply >(
121- this , METHODID_SAY_HELLO )))
122- .build ();
136+ return SimpleGrpc .bindService (this );
123137 }
124138 }
125139
126140 /**
141+ * A stub to allow clients to do asynchronous rpc calls to service Simple.
127142 * <pre>
128143 * The greeting service definition.
129144 * </pre>
130145 */
131- public static final class SimpleStub extends io .grpc .stub .AbstractAsyncStub <SimpleStub > {
146+ public static final class SimpleStub
147+ extends io .grpc .stub .AbstractAsyncStub <SimpleStub > {
132148 private SimpleStub (
133149 io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
134150 super (channel , callOptions );
@@ -153,11 +169,43 @@ public void sayHello(grpc.HelloRequest request,
153169 }
154170
155171 /**
172+ * A stub to allow clients to do synchronous rpc calls to service Simple.
173+ * <pre>
174+ * The greeting service definition.
175+ * </pre>
176+ */
177+ public static final class SimpleBlockingV2Stub
178+ extends io .grpc .stub .AbstractBlockingStub <SimpleBlockingV2Stub > {
179+ private SimpleBlockingV2Stub (
180+ io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
181+ super (channel , callOptions );
182+ }
183+
184+ @ java .lang .Override
185+ protected SimpleBlockingV2Stub build (
186+ io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
187+ return new SimpleBlockingV2Stub (channel , callOptions );
188+ }
189+
190+ /**
191+ * <pre>
192+ * Sends a greeting
193+ * </pre>
194+ */
195+ public grpc .HelloReply sayHello (grpc .HelloRequest request ) throws io .grpc .StatusException {
196+ return io .grpc .stub .ClientCalls .blockingV2UnaryCall (
197+ getChannel (), getSayHelloMethod (), getCallOptions (), request );
198+ }
199+ }
200+
201+ /**
202+ * A stub to allow clients to do limited synchronous rpc calls to service Simple.
156203 * <pre>
157204 * The greeting service definition.
158205 * </pre>
159206 */
160- public static final class SimpleBlockingStub extends io .grpc .stub .AbstractBlockingStub <SimpleBlockingStub > {
207+ public static final class SimpleBlockingStub
208+ extends io .grpc .stub .AbstractBlockingStub <SimpleBlockingStub > {
161209 private SimpleBlockingStub (
162210 io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
163211 super (channel , callOptions );
@@ -181,11 +229,13 @@ public grpc.HelloReply sayHello(grpc.HelloRequest request) {
181229 }
182230
183231 /**
232+ * A stub to allow clients to do ListenableFuture-style rpc calls to service Simple.
184233 * <pre>
185234 * The greeting service definition.
186235 * </pre>
187236 */
188- public static final class SimpleFutureStub extends io .grpc .stub .AbstractFutureStub <SimpleFutureStub > {
237+ public static final class SimpleFutureStub
238+ extends io .grpc .stub .AbstractFutureStub <SimpleFutureStub > {
189239 private SimpleFutureStub (
190240 io .grpc .Channel channel , io .grpc .CallOptions callOptions ) {
191241 super (channel , callOptions );
@@ -216,10 +266,10 @@ private static final class MethodHandlers<Req, Resp> implements
216266 io .grpc .stub .ServerCalls .ServerStreamingMethod <Req , Resp >,
217267 io .grpc .stub .ServerCalls .ClientStreamingMethod <Req , Resp >,
218268 io .grpc .stub .ServerCalls .BidiStreamingMethod <Req , Resp > {
219- private final SimpleImplBase serviceImpl ;
269+ private final AsyncService serviceImpl ;
220270 private final int methodId ;
221271
222- MethodHandlers (SimpleImplBase serviceImpl , int methodId ) {
272+ MethodHandlers (AsyncService serviceImpl , int methodId ) {
223273 this .serviceImpl = serviceImpl ;
224274 this .methodId = methodId ;
225275 }
@@ -248,6 +298,18 @@ public io.grpc.stub.StreamObserver<Req> invoke(
248298 }
249299 }
250300
301+ public static final io .grpc .ServerServiceDefinition bindService (AsyncService service ) {
302+ return io .grpc .ServerServiceDefinition .builder (getServiceDescriptor ())
303+ .addMethod (
304+ getSayHelloMethod (),
305+ io .grpc .stub .ServerCalls .asyncUnaryCall (
306+ new MethodHandlers <
307+ grpc .HelloRequest ,
308+ grpc .HelloReply >(
309+ service , METHODID_SAY_HELLO )))
310+ .build ();
311+ }
312+
251313 private static abstract class SimpleBaseDescriptorSupplier
252314 implements io .grpc .protobuf .ProtoFileDescriptorSupplier , io .grpc .protobuf .ProtoServiceDescriptorSupplier {
253315 SimpleBaseDescriptorSupplier () {}
@@ -271,9 +333,9 @@ private static final class SimpleFileDescriptorSupplier
271333 private static final class SimpleMethodDescriptorSupplier
272334 extends SimpleBaseDescriptorSupplier
273335 implements io .grpc .protobuf .ProtoMethodDescriptorSupplier {
274- private final String methodName ;
336+ private final java . lang . String methodName ;
275337
276- SimpleMethodDescriptorSupplier (String methodName ) {
338+ SimpleMethodDescriptorSupplier (java . lang . String methodName ) {
277339 this .methodName = methodName ;
278340 }
279341
0 commit comments