private ServerServiceDefinition bindService(final Greeter serviceImpl) { return io.grpc.ServerServiceDefinition.builder(GreeterGrpc.SERVICE_NAME) .addMethod( HelloJsonClient.HelloJsonStub.METHOD_SAY_HELLO, asyncUnaryCall( new UnaryMethod<HelloRequest, HelloReply>() { @Override public void invoke( HelloRequest request, StreamObserver<HelloReply> responseObserver) { serviceImpl.sayHello(request, responseObserver); } })) .build(); }
@Override public ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition .builder(GreeterGrpc.getServiceDescriptor().getName()) .addMethod(HelloJsonClient.HelloJsonStub.METHOD_SAY_HELLO, asyncUnaryCall( new UnaryMethod<HelloRequest, HelloReply>() { @Override public void invoke( HelloRequest request, StreamObserver<HelloReply> responseObserver) { sayHello(request, responseObserver); } })) .build(); }