1*e07d83d3SAndroid Build Coastguard Workerpackage io.grpc.testing.compiler; 2*e07d83d3SAndroid Build Coastguard Worker 3*e07d83d3SAndroid Build Coastguard Workerimport static io.grpc.MethodDescriptor.generateFullMethodName; 4*e07d83d3SAndroid Build Coastguard Worker 5*e07d83d3SAndroid Build Coastguard Worker/** 6*e07d83d3SAndroid Build Coastguard Worker * <pre> 7*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 8*e07d83d3SAndroid Build Coastguard Worker * </pre> 9*e07d83d3SAndroid Build Coastguard Worker */ 10*e07d83d3SAndroid Build Coastguard Worker@javax.annotation.Generated( 11*e07d83d3SAndroid Build Coastguard Worker value = "by gRPC proto compiler (version 1.56.1-SNAPSHOT)", 12*e07d83d3SAndroid Build Coastguard Worker comments = "Source: grpc/testing/compiler/test.proto") 13*e07d83d3SAndroid Build Coastguard Worker@io.grpc.stub.annotations.GrpcGenerated 14*e07d83d3SAndroid Build Coastguard Worker@java.lang.Deprecated 15*e07d83d3SAndroid Build Coastguard Workerpublic final class TestDeprecatedServiceGrpc { 16*e07d83d3SAndroid Build Coastguard Worker 17*e07d83d3SAndroid Build Coastguard Worker private TestDeprecatedServiceGrpc() {} 18*e07d83d3SAndroid Build Coastguard Worker 19*e07d83d3SAndroid Build Coastguard Worker public static final String SERVICE_NAME = "grpc.testing.compiler.TestDeprecatedService"; 20*e07d83d3SAndroid Build Coastguard Worker 21*e07d83d3SAndroid Build Coastguard Worker // Static method descriptors that strictly reflect the proto. 22*e07d83d3SAndroid Build Coastguard Worker private static volatile io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest, 23*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod; 24*e07d83d3SAndroid Build Coastguard Worker 25*e07d83d3SAndroid Build Coastguard Worker @io.grpc.stub.annotations.RpcMethod( 26*e07d83d3SAndroid Build Coastguard Worker fullMethodName = SERVICE_NAME + '/' + "DeprecatedMethod", 27*e07d83d3SAndroid Build Coastguard Worker requestType = io.grpc.testing.compiler.Test.SimpleRequest.class, 28*e07d83d3SAndroid Build Coastguard Worker responseType = io.grpc.testing.compiler.Test.SimpleResponse.class, 29*e07d83d3SAndroid Build Coastguard Worker methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 30*e07d83d3SAndroid Build Coastguard Worker public static io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest, 31*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod() { 32*e07d83d3SAndroid Build Coastguard Worker io.grpc.MethodDescriptor<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse> getDeprecatedMethodMethod; 33*e07d83d3SAndroid Build Coastguard Worker if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) { 34*e07d83d3SAndroid Build Coastguard Worker synchronized (TestDeprecatedServiceGrpc.class) { 35*e07d83d3SAndroid Build Coastguard Worker if ((getDeprecatedMethodMethod = TestDeprecatedServiceGrpc.getDeprecatedMethodMethod) == null) { 36*e07d83d3SAndroid Build Coastguard Worker TestDeprecatedServiceGrpc.getDeprecatedMethodMethod = getDeprecatedMethodMethod = 37*e07d83d3SAndroid Build Coastguard Worker io.grpc.MethodDescriptor.<io.grpc.testing.compiler.Test.SimpleRequest, io.grpc.testing.compiler.Test.SimpleResponse>newBuilder() 38*e07d83d3SAndroid Build Coastguard Worker .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 39*e07d83d3SAndroid Build Coastguard Worker .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeprecatedMethod")) 40*e07d83d3SAndroid Build Coastguard Worker .setSampledToLocalTracing(true) 41*e07d83d3SAndroid Build Coastguard Worker .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( 42*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleRequest.getDefaultInstance())) 43*e07d83d3SAndroid Build Coastguard Worker .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( 44*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleResponse.getDefaultInstance())) 45*e07d83d3SAndroid Build Coastguard Worker .setSchemaDescriptor(new TestDeprecatedServiceMethodDescriptorSupplier("DeprecatedMethod")) 46*e07d83d3SAndroid Build Coastguard Worker .build(); 47*e07d83d3SAndroid Build Coastguard Worker } 48*e07d83d3SAndroid Build Coastguard Worker } 49*e07d83d3SAndroid Build Coastguard Worker } 50*e07d83d3SAndroid Build Coastguard Worker return getDeprecatedMethodMethod; 51*e07d83d3SAndroid Build Coastguard Worker } 52*e07d83d3SAndroid Build Coastguard Worker 53*e07d83d3SAndroid Build Coastguard Worker /** 54*e07d83d3SAndroid Build Coastguard Worker * Creates a new async stub that supports all call types for the service 55*e07d83d3SAndroid Build Coastguard Worker */ 56*e07d83d3SAndroid Build Coastguard Worker public static TestDeprecatedServiceStub newStub(io.grpc.Channel channel) { 57*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceStub> factory = 58*e07d83d3SAndroid Build Coastguard Worker new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceStub>() { 59*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 60*e07d83d3SAndroid Build Coastguard Worker public TestDeprecatedServiceStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 61*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceStub(channel, callOptions); 62*e07d83d3SAndroid Build Coastguard Worker } 63*e07d83d3SAndroid Build Coastguard Worker }; 64*e07d83d3SAndroid Build Coastguard Worker return TestDeprecatedServiceStub.newStub(factory, channel); 65*e07d83d3SAndroid Build Coastguard Worker } 66*e07d83d3SAndroid Build Coastguard Worker 67*e07d83d3SAndroid Build Coastguard Worker /** 68*e07d83d3SAndroid Build Coastguard Worker * Creates a new blocking-style stub that supports unary and streaming output calls on the service 69*e07d83d3SAndroid Build Coastguard Worker */ 70*e07d83d3SAndroid Build Coastguard Worker public static TestDeprecatedServiceBlockingStub newBlockingStub( 71*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel) { 72*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceBlockingStub> factory = 73*e07d83d3SAndroid Build Coastguard Worker new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceBlockingStub>() { 74*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 75*e07d83d3SAndroid Build Coastguard Worker public TestDeprecatedServiceBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 76*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceBlockingStub(channel, callOptions); 77*e07d83d3SAndroid Build Coastguard Worker } 78*e07d83d3SAndroid Build Coastguard Worker }; 79*e07d83d3SAndroid Build Coastguard Worker return TestDeprecatedServiceBlockingStub.newStub(factory, channel); 80*e07d83d3SAndroid Build Coastguard Worker } 81*e07d83d3SAndroid Build Coastguard Worker 82*e07d83d3SAndroid Build Coastguard Worker /** 83*e07d83d3SAndroid Build Coastguard Worker * Creates a new ListenableFuture-style stub that supports unary calls on the service 84*e07d83d3SAndroid Build Coastguard Worker */ 85*e07d83d3SAndroid Build Coastguard Worker public static TestDeprecatedServiceFutureStub newFutureStub( 86*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel) { 87*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceFutureStub> factory = 88*e07d83d3SAndroid Build Coastguard Worker new io.grpc.stub.AbstractStub.StubFactory<TestDeprecatedServiceFutureStub>() { 89*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 90*e07d83d3SAndroid Build Coastguard Worker public TestDeprecatedServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 91*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceFutureStub(channel, callOptions); 92*e07d83d3SAndroid Build Coastguard Worker } 93*e07d83d3SAndroid Build Coastguard Worker }; 94*e07d83d3SAndroid Build Coastguard Worker return TestDeprecatedServiceFutureStub.newStub(factory, channel); 95*e07d83d3SAndroid Build Coastguard Worker } 96*e07d83d3SAndroid Build Coastguard Worker 97*e07d83d3SAndroid Build Coastguard Worker /** 98*e07d83d3SAndroid Build Coastguard Worker * <pre> 99*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 100*e07d83d3SAndroid Build Coastguard Worker * </pre> 101*e07d83d3SAndroid Build Coastguard Worker */ 102*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 103*e07d83d3SAndroid Build Coastguard Worker public interface AsyncService { 104*e07d83d3SAndroid Build Coastguard Worker 105*e07d83d3SAndroid Build Coastguard Worker /** 106*e07d83d3SAndroid Build Coastguard Worker * <pre> 107*e07d83d3SAndroid Build Coastguard Worker * An RPC method that has been deprecated and should generate with Java's @Deprecated annotation 108*e07d83d3SAndroid Build Coastguard Worker * </pre> 109*e07d83d3SAndroid Build Coastguard Worker */ 110*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 111*e07d83d3SAndroid Build Coastguard Worker default void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, 112*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) { 113*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getDeprecatedMethodMethod(), responseObserver); 114*e07d83d3SAndroid Build Coastguard Worker } 115*e07d83d3SAndroid Build Coastguard Worker } 116*e07d83d3SAndroid Build Coastguard Worker 117*e07d83d3SAndroid Build Coastguard Worker /** 118*e07d83d3SAndroid Build Coastguard Worker * Base class for the server implementation of the service TestDeprecatedService. 119*e07d83d3SAndroid Build Coastguard Worker * <pre> 120*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 121*e07d83d3SAndroid Build Coastguard Worker * </pre> 122*e07d83d3SAndroid Build Coastguard Worker */ 123*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 124*e07d83d3SAndroid Build Coastguard Worker public static abstract class TestDeprecatedServiceImplBase 125*e07d83d3SAndroid Build Coastguard Worker implements io.grpc.BindableService, AsyncService { 126*e07d83d3SAndroid Build Coastguard Worker 127*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { 128*e07d83d3SAndroid Build Coastguard Worker return TestDeprecatedServiceGrpc.bindService(this); 129*e07d83d3SAndroid Build Coastguard Worker } 130*e07d83d3SAndroid Build Coastguard Worker } 131*e07d83d3SAndroid Build Coastguard Worker 132*e07d83d3SAndroid Build Coastguard Worker /** 133*e07d83d3SAndroid Build Coastguard Worker * A stub to allow clients to do asynchronous rpc calls to service TestDeprecatedService. 134*e07d83d3SAndroid Build Coastguard Worker * <pre> 135*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 136*e07d83d3SAndroid Build Coastguard Worker * </pre> 137*e07d83d3SAndroid Build Coastguard Worker */ 138*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 139*e07d83d3SAndroid Build Coastguard Worker public static final class TestDeprecatedServiceStub 140*e07d83d3SAndroid Build Coastguard Worker extends io.grpc.stub.AbstractAsyncStub<TestDeprecatedServiceStub> { 141*e07d83d3SAndroid Build Coastguard Worker private TestDeprecatedServiceStub( 142*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 143*e07d83d3SAndroid Build Coastguard Worker super(channel, callOptions); 144*e07d83d3SAndroid Build Coastguard Worker } 145*e07d83d3SAndroid Build Coastguard Worker 146*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 147*e07d83d3SAndroid Build Coastguard Worker protected TestDeprecatedServiceStub build( 148*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 149*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceStub(channel, callOptions); 150*e07d83d3SAndroid Build Coastguard Worker } 151*e07d83d3SAndroid Build Coastguard Worker 152*e07d83d3SAndroid Build Coastguard Worker /** 153*e07d83d3SAndroid Build Coastguard Worker * <pre> 154*e07d83d3SAndroid Build Coastguard Worker * An RPC method that has been deprecated and should generate with Java's @Deprecated annotation 155*e07d83d3SAndroid Build Coastguard Worker * </pre> 156*e07d83d3SAndroid Build Coastguard Worker */ 157*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 158*e07d83d3SAndroid Build Coastguard Worker public void deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request, 159*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse> responseObserver) { 160*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ClientCalls.asyncUnaryCall( 161*e07d83d3SAndroid Build Coastguard Worker getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request, responseObserver); 162*e07d83d3SAndroid Build Coastguard Worker } 163*e07d83d3SAndroid Build Coastguard Worker } 164*e07d83d3SAndroid Build Coastguard Worker 165*e07d83d3SAndroid Build Coastguard Worker /** 166*e07d83d3SAndroid Build Coastguard Worker * A stub to allow clients to do synchronous rpc calls to service TestDeprecatedService. 167*e07d83d3SAndroid Build Coastguard Worker * <pre> 168*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 169*e07d83d3SAndroid Build Coastguard Worker * </pre> 170*e07d83d3SAndroid Build Coastguard Worker */ 171*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 172*e07d83d3SAndroid Build Coastguard Worker public static final class TestDeprecatedServiceBlockingStub 173*e07d83d3SAndroid Build Coastguard Worker extends io.grpc.stub.AbstractBlockingStub<TestDeprecatedServiceBlockingStub> { 174*e07d83d3SAndroid Build Coastguard Worker private TestDeprecatedServiceBlockingStub( 175*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 176*e07d83d3SAndroid Build Coastguard Worker super(channel, callOptions); 177*e07d83d3SAndroid Build Coastguard Worker } 178*e07d83d3SAndroid Build Coastguard Worker 179*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 180*e07d83d3SAndroid Build Coastguard Worker protected TestDeprecatedServiceBlockingStub build( 181*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 182*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceBlockingStub(channel, callOptions); 183*e07d83d3SAndroid Build Coastguard Worker } 184*e07d83d3SAndroid Build Coastguard Worker 185*e07d83d3SAndroid Build Coastguard Worker /** 186*e07d83d3SAndroid Build Coastguard Worker * <pre> 187*e07d83d3SAndroid Build Coastguard Worker * An RPC method that has been deprecated and should generate with Java's @Deprecated annotation 188*e07d83d3SAndroid Build Coastguard Worker * </pre> 189*e07d83d3SAndroid Build Coastguard Worker */ 190*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 191*e07d83d3SAndroid Build Coastguard Worker public io.grpc.testing.compiler.Test.SimpleResponse deprecatedMethod(io.grpc.testing.compiler.Test.SimpleRequest request) { 192*e07d83d3SAndroid Build Coastguard Worker return io.grpc.stub.ClientCalls.blockingUnaryCall( 193*e07d83d3SAndroid Build Coastguard Worker getChannel(), getDeprecatedMethodMethod(), getCallOptions(), request); 194*e07d83d3SAndroid Build Coastguard Worker } 195*e07d83d3SAndroid Build Coastguard Worker } 196*e07d83d3SAndroid Build Coastguard Worker 197*e07d83d3SAndroid Build Coastguard Worker /** 198*e07d83d3SAndroid Build Coastguard Worker * A stub to allow clients to do ListenableFuture-style rpc calls to service TestDeprecatedService. 199*e07d83d3SAndroid Build Coastguard Worker * <pre> 200*e07d83d3SAndroid Build Coastguard Worker * Test service that has been deprecated and should generate with Java's @Deprecated annotation 201*e07d83d3SAndroid Build Coastguard Worker * </pre> 202*e07d83d3SAndroid Build Coastguard Worker */ 203*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 204*e07d83d3SAndroid Build Coastguard Worker public static final class TestDeprecatedServiceFutureStub 205*e07d83d3SAndroid Build Coastguard Worker extends io.grpc.stub.AbstractFutureStub<TestDeprecatedServiceFutureStub> { 206*e07d83d3SAndroid Build Coastguard Worker private TestDeprecatedServiceFutureStub( 207*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 208*e07d83d3SAndroid Build Coastguard Worker super(channel, callOptions); 209*e07d83d3SAndroid Build Coastguard Worker } 210*e07d83d3SAndroid Build Coastguard Worker 211*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 212*e07d83d3SAndroid Build Coastguard Worker protected TestDeprecatedServiceFutureStub build( 213*e07d83d3SAndroid Build Coastguard Worker io.grpc.Channel channel, io.grpc.CallOptions callOptions) { 214*e07d83d3SAndroid Build Coastguard Worker return new TestDeprecatedServiceFutureStub(channel, callOptions); 215*e07d83d3SAndroid Build Coastguard Worker } 216*e07d83d3SAndroid Build Coastguard Worker 217*e07d83d3SAndroid Build Coastguard Worker /** 218*e07d83d3SAndroid Build Coastguard Worker * <pre> 219*e07d83d3SAndroid Build Coastguard Worker * An RPC method that has been deprecated and should generate with Java's @Deprecated annotation 220*e07d83d3SAndroid Build Coastguard Worker * </pre> 221*e07d83d3SAndroid Build Coastguard Worker */ 222*e07d83d3SAndroid Build Coastguard Worker @java.lang.Deprecated 223*e07d83d3SAndroid Build Coastguard Worker public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.compiler.Test.SimpleResponse> deprecatedMethod( 224*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleRequest request) { 225*e07d83d3SAndroid Build Coastguard Worker return io.grpc.stub.ClientCalls.futureUnaryCall( 226*e07d83d3SAndroid Build Coastguard Worker getChannel().newCall(getDeprecatedMethodMethod(), getCallOptions()), request); 227*e07d83d3SAndroid Build Coastguard Worker } 228*e07d83d3SAndroid Build Coastguard Worker } 229*e07d83d3SAndroid Build Coastguard Worker 230*e07d83d3SAndroid Build Coastguard Worker private static final int METHODID_DEPRECATED_METHOD = 0; 231*e07d83d3SAndroid Build Coastguard Worker 232*e07d83d3SAndroid Build Coastguard Worker private static final class MethodHandlers<Req, Resp> implements 233*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, 234*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, 235*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, 236*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { 237*e07d83d3SAndroid Build Coastguard Worker private final AsyncService serviceImpl; 238*e07d83d3SAndroid Build Coastguard Worker private final int methodId; 239*e07d83d3SAndroid Build Coastguard Worker 240*e07d83d3SAndroid Build Coastguard Worker MethodHandlers(AsyncService serviceImpl, int methodId) { 241*e07d83d3SAndroid Build Coastguard Worker this.serviceImpl = serviceImpl; 242*e07d83d3SAndroid Build Coastguard Worker this.methodId = methodId; 243*e07d83d3SAndroid Build Coastguard Worker } 244*e07d83d3SAndroid Build Coastguard Worker 245*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 246*e07d83d3SAndroid Build Coastguard Worker @java.lang.SuppressWarnings("unchecked") 247*e07d83d3SAndroid Build Coastguard Worker public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) { 248*e07d83d3SAndroid Build Coastguard Worker switch (methodId) { 249*e07d83d3SAndroid Build Coastguard Worker case METHODID_DEPRECATED_METHOD: 250*e07d83d3SAndroid Build Coastguard Worker serviceImpl.deprecatedMethod((io.grpc.testing.compiler.Test.SimpleRequest) request, 251*e07d83d3SAndroid Build Coastguard Worker (io.grpc.stub.StreamObserver<io.grpc.testing.compiler.Test.SimpleResponse>) responseObserver); 252*e07d83d3SAndroid Build Coastguard Worker break; 253*e07d83d3SAndroid Build Coastguard Worker default: 254*e07d83d3SAndroid Build Coastguard Worker throw new AssertionError(); 255*e07d83d3SAndroid Build Coastguard Worker } 256*e07d83d3SAndroid Build Coastguard Worker } 257*e07d83d3SAndroid Build Coastguard Worker 258*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 259*e07d83d3SAndroid Build Coastguard Worker @java.lang.SuppressWarnings("unchecked") 260*e07d83d3SAndroid Build Coastguard Worker public io.grpc.stub.StreamObserver<Req> invoke( 261*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.StreamObserver<Resp> responseObserver) { 262*e07d83d3SAndroid Build Coastguard Worker switch (methodId) { 263*e07d83d3SAndroid Build Coastguard Worker default: 264*e07d83d3SAndroid Build Coastguard Worker throw new AssertionError(); 265*e07d83d3SAndroid Build Coastguard Worker } 266*e07d83d3SAndroid Build Coastguard Worker } 267*e07d83d3SAndroid Build Coastguard Worker } 268*e07d83d3SAndroid Build Coastguard Worker 269*e07d83d3SAndroid Build Coastguard Worker public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { 270*e07d83d3SAndroid Build Coastguard Worker return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 271*e07d83d3SAndroid Build Coastguard Worker .addMethod( 272*e07d83d3SAndroid Build Coastguard Worker getDeprecatedMethodMethod(), 273*e07d83d3SAndroid Build Coastguard Worker io.grpc.stub.ServerCalls.asyncUnaryCall( 274*e07d83d3SAndroid Build Coastguard Worker new MethodHandlers< 275*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleRequest, 276*e07d83d3SAndroid Build Coastguard Worker io.grpc.testing.compiler.Test.SimpleResponse>( 277*e07d83d3SAndroid Build Coastguard Worker service, METHODID_DEPRECATED_METHOD))) 278*e07d83d3SAndroid Build Coastguard Worker .build(); 279*e07d83d3SAndroid Build Coastguard Worker } 280*e07d83d3SAndroid Build Coastguard Worker 281*e07d83d3SAndroid Build Coastguard Worker private static abstract class TestDeprecatedServiceBaseDescriptorSupplier 282*e07d83d3SAndroid Build Coastguard Worker implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { 283*e07d83d3SAndroid Build Coastguard Worker TestDeprecatedServiceBaseDescriptorSupplier() {} 284*e07d83d3SAndroid Build Coastguard Worker 285*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 286*e07d83d3SAndroid Build Coastguard Worker public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 287*e07d83d3SAndroid Build Coastguard Worker return io.grpc.testing.compiler.Test.getDescriptor(); 288*e07d83d3SAndroid Build Coastguard Worker } 289*e07d83d3SAndroid Build Coastguard Worker 290*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 291*e07d83d3SAndroid Build Coastguard Worker public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 292*e07d83d3SAndroid Build Coastguard Worker return getFileDescriptor().findServiceByName("TestDeprecatedService"); 293*e07d83d3SAndroid Build Coastguard Worker } 294*e07d83d3SAndroid Build Coastguard Worker } 295*e07d83d3SAndroid Build Coastguard Worker 296*e07d83d3SAndroid Build Coastguard Worker private static final class TestDeprecatedServiceFileDescriptorSupplier 297*e07d83d3SAndroid Build Coastguard Worker extends TestDeprecatedServiceBaseDescriptorSupplier { 298*e07d83d3SAndroid Build Coastguard Worker TestDeprecatedServiceFileDescriptorSupplier() {} 299*e07d83d3SAndroid Build Coastguard Worker } 300*e07d83d3SAndroid Build Coastguard Worker 301*e07d83d3SAndroid Build Coastguard Worker private static final class TestDeprecatedServiceMethodDescriptorSupplier 302*e07d83d3SAndroid Build Coastguard Worker extends TestDeprecatedServiceBaseDescriptorSupplier 303*e07d83d3SAndroid Build Coastguard Worker implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 304*e07d83d3SAndroid Build Coastguard Worker private final String methodName; 305*e07d83d3SAndroid Build Coastguard Worker 306*e07d83d3SAndroid Build Coastguard Worker TestDeprecatedServiceMethodDescriptorSupplier(String methodName) { 307*e07d83d3SAndroid Build Coastguard Worker this.methodName = methodName; 308*e07d83d3SAndroid Build Coastguard Worker } 309*e07d83d3SAndroid Build Coastguard Worker 310*e07d83d3SAndroid Build Coastguard Worker @java.lang.Override 311*e07d83d3SAndroid Build Coastguard Worker public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 312*e07d83d3SAndroid Build Coastguard Worker return getServiceDescriptor().findMethodByName(methodName); 313*e07d83d3SAndroid Build Coastguard Worker } 314*e07d83d3SAndroid Build Coastguard Worker } 315*e07d83d3SAndroid Build Coastguard Worker 316*e07d83d3SAndroid Build Coastguard Worker private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 317*e07d83d3SAndroid Build Coastguard Worker 318*e07d83d3SAndroid Build Coastguard Worker public static io.grpc.ServiceDescriptor getServiceDescriptor() { 319*e07d83d3SAndroid Build Coastguard Worker io.grpc.ServiceDescriptor result = serviceDescriptor; 320*e07d83d3SAndroid Build Coastguard Worker if (result == null) { 321*e07d83d3SAndroid Build Coastguard Worker synchronized (TestDeprecatedServiceGrpc.class) { 322*e07d83d3SAndroid Build Coastguard Worker result = serviceDescriptor; 323*e07d83d3SAndroid Build Coastguard Worker if (result == null) { 324*e07d83d3SAndroid Build Coastguard Worker serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 325*e07d83d3SAndroid Build Coastguard Worker .setSchemaDescriptor(new TestDeprecatedServiceFileDescriptorSupplier()) 326*e07d83d3SAndroid Build Coastguard Worker .addMethod(getDeprecatedMethodMethod()) 327*e07d83d3SAndroid Build Coastguard Worker .build(); 328*e07d83d3SAndroid Build Coastguard Worker } 329*e07d83d3SAndroid Build Coastguard Worker } 330*e07d83d3SAndroid Build Coastguard Worker } 331*e07d83d3SAndroid Build Coastguard Worker return result; 332*e07d83d3SAndroid Build Coastguard Worker } 333*e07d83d3SAndroid Build Coastguard Worker} 334