|
| 1 | +package io.grpc.examples; |
| 2 | + |
| 3 | +import static io.grpc.MethodDescriptor.generateFullMethodName; |
| 4 | + |
| 5 | +/** |
| 6 | + */ |
| 7 | +@javax.annotation.Generated( |
| 8 | + value = "by gRPC proto compiler (version 1.36.0)", |
| 9 | + comments = "Source: request_scoped.proto") |
| 10 | +public final class RequestScopedGrpc { |
| 11 | + |
| 12 | + private RequestScopedGrpc() {} |
| 13 | + |
| 14 | + public static final String SERVICE_NAME = "RequestScoped"; |
| 15 | + |
| 16 | + // Static method descriptors that strictly reflect the proto. |
| 17 | + private static volatile io.grpc.MethodDescriptor<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage, |
| 18 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> getRequestScopedMethod; |
| 19 | + |
| 20 | + @io.grpc.stub.annotations.RpcMethod( |
| 21 | + fullMethodName = SERVICE_NAME + '/' + "RequestScoped", |
| 22 | + requestType = io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage.class, |
| 23 | + responseType = io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage.class, |
| 24 | + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) |
| 25 | + public static io.grpc.MethodDescriptor<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage, |
| 26 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> getRequestScopedMethod() { |
| 27 | + io.grpc.MethodDescriptor<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage, io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> getRequestScopedMethod; |
| 28 | + if ((getRequestScopedMethod = RequestScopedGrpc.getRequestScopedMethod) == null) { |
| 29 | + synchronized (RequestScopedGrpc.class) { |
| 30 | + if ((getRequestScopedMethod = RequestScopedGrpc.getRequestScopedMethod) == null) { |
| 31 | + RequestScopedGrpc.getRequestScopedMethod = getRequestScopedMethod = |
| 32 | + io.grpc.MethodDescriptor.<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage, io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage>newBuilder() |
| 33 | + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) |
| 34 | + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "RequestScoped")) |
| 35 | + .setSampledToLocalTracing(true) |
| 36 | + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( |
| 37 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage.getDefaultInstance())) |
| 38 | + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( |
| 39 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage.getDefaultInstance())) |
| 40 | + .setSchemaDescriptor(new RequestScopedMethodDescriptorSupplier("RequestScoped")) |
| 41 | + .build(); |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | + return getRequestScopedMethod; |
| 46 | + } |
| 47 | + |
| 48 | + /** |
| 49 | + * Creates a new async stub that supports all call types for the service |
| 50 | + */ |
| 51 | + public static RequestScopedStub newStub(io.grpc.Channel channel) { |
| 52 | + io.grpc.stub.AbstractStub.StubFactory<RequestScopedStub> factory = |
| 53 | + new io.grpc.stub.AbstractStub.StubFactory<RequestScopedStub>() { |
| 54 | + @java.lang.Override |
| 55 | + public RequestScopedStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 56 | + return new RequestScopedStub(channel, callOptions); |
| 57 | + } |
| 58 | + }; |
| 59 | + return RequestScopedStub.newStub(factory, channel); |
| 60 | + } |
| 61 | + |
| 62 | + /** |
| 63 | + * Creates a new blocking-style stub that supports unary and streaming output calls on the service |
| 64 | + */ |
| 65 | + public static RequestScopedBlockingStub newBlockingStub( |
| 66 | + io.grpc.Channel channel) { |
| 67 | + io.grpc.stub.AbstractStub.StubFactory<RequestScopedBlockingStub> factory = |
| 68 | + new io.grpc.stub.AbstractStub.StubFactory<RequestScopedBlockingStub>() { |
| 69 | + @java.lang.Override |
| 70 | + public RequestScopedBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 71 | + return new RequestScopedBlockingStub(channel, callOptions); |
| 72 | + } |
| 73 | + }; |
| 74 | + return RequestScopedBlockingStub.newStub(factory, channel); |
| 75 | + } |
| 76 | + |
| 77 | + /** |
| 78 | + * Creates a new ListenableFuture-style stub that supports unary calls on the service |
| 79 | + */ |
| 80 | + public static RequestScopedFutureStub newFutureStub( |
| 81 | + io.grpc.Channel channel) { |
| 82 | + io.grpc.stub.AbstractStub.StubFactory<RequestScopedFutureStub> factory = |
| 83 | + new io.grpc.stub.AbstractStub.StubFactory<RequestScopedFutureStub>() { |
| 84 | + @java.lang.Override |
| 85 | + public RequestScopedFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 86 | + return new RequestScopedFutureStub(channel, callOptions); |
| 87 | + } |
| 88 | + }; |
| 89 | + return RequestScopedFutureStub.newStub(factory, channel); |
| 90 | + } |
| 91 | + |
| 92 | + /** |
| 93 | + */ |
| 94 | + public static abstract class RequestScopedImplBase implements io.grpc.BindableService { |
| 95 | + |
| 96 | + /** |
| 97 | + */ |
| 98 | + public io.grpc.stub.StreamObserver<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> requestScoped( |
| 99 | + io.grpc.stub.StreamObserver<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> responseObserver) { |
| 100 | + return io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall(getRequestScopedMethod(), responseObserver); |
| 101 | + } |
| 102 | + |
| 103 | + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { |
| 104 | + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) |
| 105 | + .addMethod( |
| 106 | + getRequestScopedMethod(), |
| 107 | + io.grpc.stub.ServerCalls.asyncBidiStreamingCall( |
| 108 | + new MethodHandlers< |
| 109 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage, |
| 110 | + io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage>( |
| 111 | + this, METHODID_REQUEST_SCOPED))) |
| 112 | + .build(); |
| 113 | + } |
| 114 | + } |
| 115 | + |
| 116 | + /** |
| 117 | + */ |
| 118 | + public static final class RequestScopedStub extends io.grpc.stub.AbstractAsyncStub<RequestScopedStub> { |
| 119 | + private RequestScopedStub( |
| 120 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 121 | + super(channel, callOptions); |
| 122 | + } |
| 123 | + |
| 124 | + @java.lang.Override |
| 125 | + protected RequestScopedStub build( |
| 126 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 127 | + return new RequestScopedStub(channel, callOptions); |
| 128 | + } |
| 129 | + |
| 130 | + /** |
| 131 | + */ |
| 132 | + public io.grpc.stub.StreamObserver<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> requestScoped( |
| 133 | + io.grpc.stub.StreamObserver<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage> responseObserver) { |
| 134 | + return io.grpc.stub.ClientCalls.asyncBidiStreamingCall( |
| 135 | + getChannel().newCall(getRequestScopedMethod(), getCallOptions()), responseObserver); |
| 136 | + } |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + */ |
| 141 | + public static final class RequestScopedBlockingStub extends io.grpc.stub.AbstractBlockingStub<RequestScopedBlockingStub> { |
| 142 | + private RequestScopedBlockingStub( |
| 143 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 144 | + super(channel, callOptions); |
| 145 | + } |
| 146 | + |
| 147 | + @java.lang.Override |
| 148 | + protected RequestScopedBlockingStub build( |
| 149 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 150 | + return new RequestScopedBlockingStub(channel, callOptions); |
| 151 | + } |
| 152 | + } |
| 153 | + |
| 154 | + /** |
| 155 | + */ |
| 156 | + public static final class RequestScopedFutureStub extends io.grpc.stub.AbstractFutureStub<RequestScopedFutureStub> { |
| 157 | + private RequestScopedFutureStub( |
| 158 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 159 | + super(channel, callOptions); |
| 160 | + } |
| 161 | + |
| 162 | + @java.lang.Override |
| 163 | + protected RequestScopedFutureStub build( |
| 164 | + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { |
| 165 | + return new RequestScopedFutureStub(channel, callOptions); |
| 166 | + } |
| 167 | + } |
| 168 | + |
| 169 | + private static final int METHODID_REQUEST_SCOPED = 0; |
| 170 | + |
| 171 | + private static final class MethodHandlers<Req, Resp> implements |
| 172 | + io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, |
| 173 | + io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, |
| 174 | + io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, |
| 175 | + io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { |
| 176 | + private final RequestScopedImplBase serviceImpl; |
| 177 | + private final int methodId; |
| 178 | + |
| 179 | + MethodHandlers(RequestScopedImplBase serviceImpl, int methodId) { |
| 180 | + this.serviceImpl = serviceImpl; |
| 181 | + this.methodId = methodId; |
| 182 | + } |
| 183 | + |
| 184 | + @java.lang.Override |
| 185 | + @java.lang.SuppressWarnings("unchecked") |
| 186 | + public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 187 | + switch (methodId) { |
| 188 | + default: |
| 189 | + throw new AssertionError(); |
| 190 | + } |
| 191 | + } |
| 192 | + |
| 193 | + @java.lang.Override |
| 194 | + @java.lang.SuppressWarnings("unchecked") |
| 195 | + public io.grpc.stub.StreamObserver<Req> invoke( |
| 196 | + io.grpc.stub.StreamObserver<Resp> responseObserver) { |
| 197 | + switch (methodId) { |
| 198 | + case METHODID_REQUEST_SCOPED: |
| 199 | + return (io.grpc.stub.StreamObserver<Req>) serviceImpl.requestScoped( |
| 200 | + (io.grpc.stub.StreamObserver<io.grpc.examples.RequestScopedOuterClass.RequestScopedMessage>) responseObserver); |
| 201 | + default: |
| 202 | + throw new AssertionError(); |
| 203 | + } |
| 204 | + } |
| 205 | + } |
| 206 | + |
| 207 | + private static abstract class RequestScopedBaseDescriptorSupplier |
| 208 | + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { |
| 209 | + RequestScopedBaseDescriptorSupplier() {} |
| 210 | + |
| 211 | + @java.lang.Override |
| 212 | + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { |
| 213 | + return io.grpc.examples.RequestScopedOuterClass.getDescriptor(); |
| 214 | + } |
| 215 | + |
| 216 | + @java.lang.Override |
| 217 | + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { |
| 218 | + return getFileDescriptor().findServiceByName("RequestScoped"); |
| 219 | + } |
| 220 | + } |
| 221 | + |
| 222 | + private static final class RequestScopedFileDescriptorSupplier |
| 223 | + extends RequestScopedBaseDescriptorSupplier { |
| 224 | + RequestScopedFileDescriptorSupplier() {} |
| 225 | + } |
| 226 | + |
| 227 | + private static final class RequestScopedMethodDescriptorSupplier |
| 228 | + extends RequestScopedBaseDescriptorSupplier |
| 229 | + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { |
| 230 | + private final String methodName; |
| 231 | + |
| 232 | + RequestScopedMethodDescriptorSupplier(String methodName) { |
| 233 | + this.methodName = methodName; |
| 234 | + } |
| 235 | + |
| 236 | + @java.lang.Override |
| 237 | + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { |
| 238 | + return getServiceDescriptor().findMethodByName(methodName); |
| 239 | + } |
| 240 | + } |
| 241 | + |
| 242 | + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; |
| 243 | + |
| 244 | + public static io.grpc.ServiceDescriptor getServiceDescriptor() { |
| 245 | + io.grpc.ServiceDescriptor result = serviceDescriptor; |
| 246 | + if (result == null) { |
| 247 | + synchronized (RequestScopedGrpc.class) { |
| 248 | + result = serviceDescriptor; |
| 249 | + if (result == null) { |
| 250 | + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) |
| 251 | + .setSchemaDescriptor(new RequestScopedFileDescriptorSupplier()) |
| 252 | + .addMethod(getRequestScopedMethod()) |
| 253 | + .build(); |
| 254 | + } |
| 255 | + } |
| 256 | + } |
| 257 | + return result; |
| 258 | + } |
| 259 | +} |
0 commit comments