mirror of https://github.com/grpc/grpc-java.git
442 lines
21 KiB
Plaintext
442 lines
21 KiB
Plaintext
package io.grpc.testing.integration.nano;
|
|
|
|
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
|
|
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
|
|
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
|
|
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
|
|
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
|
|
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
|
|
import static io.grpc.stub.ClientCalls.futureUnaryCall;
|
|
import static io.grpc.MethodDescriptor.generateFullMethodName;
|
|
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
|
|
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
|
|
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
|
|
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
|
|
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
|
|
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
|
|
|
|
import java.io.IOException;
|
|
|
|
@javax.annotation.Generated(
|
|
value = "by gRPC proto compiler (version 0.14.0-SNAPSHOT)",
|
|
comments = "Source: test.proto")
|
|
public class TestServiceGrpc {
|
|
|
|
private TestServiceGrpc() {}
|
|
|
|
public static final String SERVICE_NAME = "grpc.testing.TestService";
|
|
|
|
// Static method descriptors that strictly reflect the proto.
|
|
private static final int ARG_IN_METHOD_UNARY_CALL = 0;
|
|
private static final int ARG_OUT_METHOD_UNARY_CALL = 1;
|
|
@io.grpc.ExperimentalApi
|
|
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.SimpleRequest,
|
|
io.grpc.testing.integration.nano.Test.SimpleResponse> METHOD_UNARY_CALL =
|
|
io.grpc.MethodDescriptor.create(
|
|
io.grpc.MethodDescriptor.MethodType.UNARY,
|
|
generateFullMethodName(
|
|
"grpc.testing.TestService", "UnaryCall"),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleRequest>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleRequest>(ARG_IN_METHOD_UNARY_CALL)),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.SimpleResponse>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.SimpleResponse>(ARG_OUT_METHOD_UNARY_CALL))
|
|
);
|
|
private static final int ARG_IN_METHOD_STREAMING_OUTPUT_CALL = 2;
|
|
private static final int ARG_OUT_METHOD_STREAMING_OUTPUT_CALL = 3;
|
|
@io.grpc.ExperimentalApi
|
|
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_STREAMING_OUTPUT_CALL =
|
|
io.grpc.MethodDescriptor.create(
|
|
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
|
|
generateFullMethodName(
|
|
"grpc.testing.TestService", "StreamingOutputCall"),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_STREAMING_OUTPUT_CALL)),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_STREAMING_OUTPUT_CALL))
|
|
);
|
|
private static final int ARG_IN_METHOD_STREAMING_INPUT_CALL = 4;
|
|
private static final int ARG_OUT_METHOD_STREAMING_INPUT_CALL = 5;
|
|
@io.grpc.ExperimentalApi
|
|
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> METHOD_STREAMING_INPUT_CALL =
|
|
io.grpc.MethodDescriptor.create(
|
|
io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
|
|
generateFullMethodName(
|
|
"grpc.testing.TestService", "StreamingInputCall"),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest>(ARG_IN_METHOD_STREAMING_INPUT_CALL)),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>(ARG_OUT_METHOD_STREAMING_INPUT_CALL))
|
|
);
|
|
private static final int ARG_IN_METHOD_FULL_BIDI_CALL = 6;
|
|
private static final int ARG_OUT_METHOD_FULL_BIDI_CALL = 7;
|
|
@io.grpc.ExperimentalApi
|
|
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_FULL_BIDI_CALL =
|
|
io.grpc.MethodDescriptor.create(
|
|
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
|
|
generateFullMethodName(
|
|
"grpc.testing.TestService", "FullBidiCall"),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_FULL_BIDI_CALL)),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_FULL_BIDI_CALL))
|
|
);
|
|
private static final int ARG_IN_METHOD_HALF_BIDI_CALL = 8;
|
|
private static final int ARG_OUT_METHOD_HALF_BIDI_CALL = 9;
|
|
@io.grpc.ExperimentalApi
|
|
public static final io.grpc.MethodDescriptor<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> METHOD_HALF_BIDI_CALL =
|
|
io.grpc.MethodDescriptor.create(
|
|
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
|
|
generateFullMethodName(
|
|
"grpc.testing.TestService", "HalfBidiCall"),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest>(ARG_IN_METHOD_HALF_BIDI_CALL)),
|
|
io.grpc.protobuf.nano.NanoUtils.<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>marshaller(
|
|
new NanoFactory<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(ARG_OUT_METHOD_HALF_BIDI_CALL))
|
|
);
|
|
|
|
private static final class NanoFactory<T extends com.google.protobuf.nano.MessageNano>
|
|
implements io.grpc.protobuf.nano.MessageNanoFactory<T> {
|
|
private final int id;
|
|
|
|
NanoFactory(int id) {
|
|
this.id = id;
|
|
}
|
|
|
|
@java.lang.Override
|
|
public T newInstance() {
|
|
Object o;
|
|
switch (id) {
|
|
case ARG_IN_METHOD_UNARY_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.SimpleRequest();
|
|
break;
|
|
case ARG_OUT_METHOD_UNARY_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.SimpleResponse();
|
|
break;
|
|
case ARG_IN_METHOD_STREAMING_OUTPUT_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
|
|
break;
|
|
case ARG_OUT_METHOD_STREAMING_OUTPUT_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
|
|
break;
|
|
case ARG_IN_METHOD_STREAMING_INPUT_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingInputCallRequest();
|
|
break;
|
|
case ARG_OUT_METHOD_STREAMING_INPUT_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingInputCallResponse();
|
|
break;
|
|
case ARG_IN_METHOD_FULL_BIDI_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
|
|
break;
|
|
case ARG_OUT_METHOD_FULL_BIDI_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
|
|
break;
|
|
case ARG_IN_METHOD_HALF_BIDI_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest();
|
|
break;
|
|
case ARG_OUT_METHOD_HALF_BIDI_CALL:
|
|
o = new io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse();
|
|
break;
|
|
default:
|
|
throw new AssertionError();
|
|
}
|
|
@java.lang.SuppressWarnings("unchecked")
|
|
T t = (T) o;
|
|
return t;
|
|
}
|
|
}
|
|
|
|
public static TestServiceStub newStub(io.grpc.Channel channel) {
|
|
return new TestServiceStub(channel);
|
|
}
|
|
|
|
public static TestServiceBlockingStub newBlockingStub(
|
|
io.grpc.Channel channel) {
|
|
return new TestServiceBlockingStub(channel);
|
|
}
|
|
|
|
public static TestServiceFutureStub newFutureStub(
|
|
io.grpc.Channel channel) {
|
|
return new TestServiceFutureStub(channel);
|
|
}
|
|
|
|
public static interface TestService {
|
|
|
|
public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver);
|
|
|
|
public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
|
|
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver);
|
|
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
|
|
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver);
|
|
}
|
|
|
|
@io.grpc.ExperimentalApi
|
|
public static abstract class AbstractTestService implements TestService, io.grpc.BindableService {
|
|
|
|
@java.lang.Override
|
|
public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) {
|
|
asyncUnimplementedUnaryCall(METHOD_UNARY_CALL, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
asyncUnimplementedUnaryCall(METHOD_STREAMING_OUTPUT_CALL, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) {
|
|
return asyncUnimplementedStreamingCall(METHOD_STREAMING_INPUT_CALL, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
return asyncUnimplementedStreamingCall(METHOD_FULL_BIDI_CALL, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
return asyncUnimplementedStreamingCall(METHOD_HALF_BIDI_CALL, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
|
|
return TestServiceGrpc.bindService(this);
|
|
}
|
|
}
|
|
|
|
public static interface TestServiceBlockingClient {
|
|
|
|
public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request);
|
|
|
|
public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall(
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request);
|
|
}
|
|
|
|
public static interface TestServiceFutureClient {
|
|
|
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall(
|
|
io.grpc.testing.integration.nano.Test.SimpleRequest request);
|
|
}
|
|
|
|
public static class TestServiceStub extends io.grpc.stub.AbstractStub<TestServiceStub>
|
|
implements TestService {
|
|
private TestServiceStub(io.grpc.Channel channel) {
|
|
super(channel);
|
|
}
|
|
|
|
private TestServiceStub(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
super(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
protected TestServiceStub build(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
return new TestServiceStub(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public void unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse> responseObserver) {
|
|
asyncUnaryCall(
|
|
getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public void streamingOutputCall(io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request,
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
asyncServerStreamingCall(
|
|
getChannel().newCall(METHOD_STREAMING_OUTPUT_CALL, getCallOptions()), request, responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallRequest> streamingInputCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse> responseObserver) {
|
|
return asyncClientStreamingCall(
|
|
getChannel().newCall(METHOD_STREAMING_INPUT_CALL, getCallOptions()), responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> fullBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
return asyncBidiStreamingCall(
|
|
getChannel().newCall(METHOD_FULL_BIDI_CALL, getCallOptions()), responseObserver);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest> halfBidiCall(
|
|
io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> responseObserver) {
|
|
return asyncBidiStreamingCall(
|
|
getChannel().newCall(METHOD_HALF_BIDI_CALL, getCallOptions()), responseObserver);
|
|
}
|
|
}
|
|
|
|
public static class TestServiceBlockingStub extends io.grpc.stub.AbstractStub<TestServiceBlockingStub>
|
|
implements TestServiceBlockingClient {
|
|
private TestServiceBlockingStub(io.grpc.Channel channel) {
|
|
super(channel);
|
|
}
|
|
|
|
private TestServiceBlockingStub(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
super(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
protected TestServiceBlockingStub build(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
return new TestServiceBlockingStub(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public io.grpc.testing.integration.nano.Test.SimpleResponse unaryCall(io.grpc.testing.integration.nano.Test.SimpleRequest request) {
|
|
return blockingUnaryCall(
|
|
getChannel(), METHOD_UNARY_CALL, getCallOptions(), request);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public java.util.Iterator<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse> streamingOutputCall(
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest request) {
|
|
return blockingServerStreamingCall(
|
|
getChannel(), METHOD_STREAMING_OUTPUT_CALL, getCallOptions(), request);
|
|
}
|
|
}
|
|
|
|
public static class TestServiceFutureStub extends io.grpc.stub.AbstractStub<TestServiceFutureStub>
|
|
implements TestServiceFutureClient {
|
|
private TestServiceFutureStub(io.grpc.Channel channel) {
|
|
super(channel);
|
|
}
|
|
|
|
private TestServiceFutureStub(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
super(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
protected TestServiceFutureStub build(io.grpc.Channel channel,
|
|
io.grpc.CallOptions callOptions) {
|
|
return new TestServiceFutureStub(channel, callOptions);
|
|
}
|
|
|
|
@java.lang.Override
|
|
public com.google.common.util.concurrent.ListenableFuture<io.grpc.testing.integration.nano.Test.SimpleResponse> unaryCall(
|
|
io.grpc.testing.integration.nano.Test.SimpleRequest request) {
|
|
return futureUnaryCall(
|
|
getChannel().newCall(METHOD_UNARY_CALL, getCallOptions()), request);
|
|
}
|
|
}
|
|
|
|
private static final int METHODID_UNARY_CALL = 0;
|
|
private static final int METHODID_STREAMING_OUTPUT_CALL = 1;
|
|
private static final int METHODID_STREAMING_INPUT_CALL = 2;
|
|
private static final int METHODID_FULL_BIDI_CALL = 3;
|
|
private static final int METHODID_HALF_BIDI_CALL = 4;
|
|
|
|
private static class MethodHandlers<Req, Resp> implements
|
|
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
|
|
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
|
|
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
|
|
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
|
|
private final TestService serviceImpl;
|
|
private final int methodId;
|
|
|
|
public MethodHandlers(TestService serviceImpl, int methodId) {
|
|
this.serviceImpl = serviceImpl;
|
|
this.methodId = methodId;
|
|
}
|
|
|
|
@java.lang.Override
|
|
@java.lang.SuppressWarnings("unchecked")
|
|
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
|
switch (methodId) {
|
|
case METHODID_UNARY_CALL:
|
|
serviceImpl.unaryCall((io.grpc.testing.integration.nano.Test.SimpleRequest) request,
|
|
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.SimpleResponse>) responseObserver);
|
|
break;
|
|
case METHODID_STREAMING_OUTPUT_CALL:
|
|
serviceImpl.streamingOutputCall((io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest) request,
|
|
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver);
|
|
break;
|
|
default:
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
|
|
@java.lang.Override
|
|
@java.lang.SuppressWarnings("unchecked")
|
|
public io.grpc.stub.StreamObserver<Req> invoke(
|
|
io.grpc.stub.StreamObserver<Resp> responseObserver) {
|
|
switch (methodId) {
|
|
case METHODID_STREAMING_INPUT_CALL:
|
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.streamingInputCall(
|
|
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>) responseObserver);
|
|
case METHODID_FULL_BIDI_CALL:
|
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.fullBidiCall(
|
|
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver);
|
|
case METHODID_HALF_BIDI_CALL:
|
|
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.halfBidiCall(
|
|
(io.grpc.stub.StreamObserver<io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>) responseObserver);
|
|
default:
|
|
throw new AssertionError();
|
|
}
|
|
}
|
|
}
|
|
|
|
public static io.grpc.ServerServiceDefinition bindService(
|
|
final TestService serviceImpl) {
|
|
return io.grpc.ServerServiceDefinition.builder(SERVICE_NAME)
|
|
.addMethod(
|
|
METHOD_UNARY_CALL,
|
|
asyncUnaryCall(
|
|
new MethodHandlers<
|
|
io.grpc.testing.integration.nano.Test.SimpleRequest,
|
|
io.grpc.testing.integration.nano.Test.SimpleResponse>(
|
|
serviceImpl, METHODID_UNARY_CALL)))
|
|
.addMethod(
|
|
METHOD_STREAMING_OUTPUT_CALL,
|
|
asyncServerStreamingCall(
|
|
new MethodHandlers<
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
|
|
serviceImpl, METHODID_STREAMING_OUTPUT_CALL)))
|
|
.addMethod(
|
|
METHOD_STREAMING_INPUT_CALL,
|
|
asyncClientStreamingCall(
|
|
new MethodHandlers<
|
|
io.grpc.testing.integration.nano.Test.StreamingInputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingInputCallResponse>(
|
|
serviceImpl, METHODID_STREAMING_INPUT_CALL)))
|
|
.addMethod(
|
|
METHOD_FULL_BIDI_CALL,
|
|
asyncBidiStreamingCall(
|
|
new MethodHandlers<
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
|
|
serviceImpl, METHODID_FULL_BIDI_CALL)))
|
|
.addMethod(
|
|
METHOD_HALF_BIDI_CALL,
|
|
asyncBidiStreamingCall(
|
|
new MethodHandlers<
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallRequest,
|
|
io.grpc.testing.integration.nano.Test.StreamingOutputCallResponse>(
|
|
serviceImpl, METHODID_HALF_BIDI_CALL)))
|
|
.build();
|
|
}
|
|
}
|