Interface MethodHandler<ReqT,RespT>
- Type Parameters:
ReqT- the request typeRespT- the response type
- All Superinterfaces:
io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT, RespT>, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT, RespT>, io.grpc.stub.ServerCalls.UnaryMethod<ReqT, RespT>
public interface MethodHandler<ReqT,RespT>
extends io.grpc.stub.ServerCalls.UnaryMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.ClientStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.ServerStreamingMethod<ReqT,RespT>, io.grpc.stub.ServerCalls.BidiStreamingMethod<ReqT,RespT>
A gRPC method call handler.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA bidirectional client call handler.static interfaceA client streaming client call handler.static interfaceA server streaming client call handler.static interfaceA unary client call handler. -
Method Summary
Modifier and TypeMethodDescriptiondefault Objectbidirectional(Object[] args, MethodHandler.BidirectionalClient client) Handle a bi-directional client call.default booleanDetermine whether this is a client side only handler.default ObjectclientStreaming(Object[] args, MethodHandler.ClientStreaming client) Handle a bi-directional client call.Class<?> Obtain the request type.Class<?> Obtain the response type.default io.grpc.stub.StreamObserver<ReqT> default voidObtain the name of the underlying Java method that this handler maps to.default ObjectserverStreaming(Object[] args, MethodHandler.ServerStreamingClient client) Handle a bi-directional client call.io.grpc.MethodDescriptor.MethodTypetype()Obtain thegRPC method tyoethat thisMethodHandlerhandles.default Objectunary(Object[] args, MethodHandler.UnaryClient client) Handle a bi-directional client call.
-
Method Details
-
type
io.grpc.MethodDescriptor.MethodType type()Obtain thegRPC method tyoethat thisMethodHandlerhandles.- Returns:
- the
gRPC method typethat thisMethodHandlerhandles
-
getRequestType
-
getResponseType
-
javaMethodName
String javaMethodName()Obtain the name of the underlying Java method that this handler maps to.- Returns:
- the name of the underlying Java method that this handler maps to
-
clientOnly
default boolean clientOnly()Determine whether this is a client side only handler.- Returns:
trueif this handler can only be used on the client
-
invoke
-
invoke
-
bidirectional
Handle a bi-directional client call.- Parameters:
args- the call arguments.client- theMethodHandler.BidirectionalClientinstance to forward the call to.- Returns:
- the call result
-
clientStreaming
Handle a bi-directional client call.- Parameters:
args- the call arguments.client- theMethodHandler.ClientStreaminginstance to forward the call to.- Returns:
- the call result
-
serverStreaming
Handle a bi-directional client call.- Parameters:
args- the call arguments.client- theMethodHandler.ServerStreamingClientinstance to forward the call to.- Returns:
- the call result
-
unary
Handle a bi-directional client call.- Parameters:
args- the call arguments.client- theMethodHandler.UnaryClientinstance to forward the call to.- Returns:
- the call result
-