- 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>
- All Known Implementing Classes:
io.helidon.microprofile.grpc.core.AbstractMethodHandlerSupplier.AbstractHandler
,BidirectionalMethodHandlerSupplier.AbstractServerStreamingHandler
,BidirectionalMethodHandlerSupplier.BidiStreaming
,ClientStreamingMethodHandlerSupplier.AbstractClientStreamingHandler
,ClientStreamingMethodHandlerSupplier.ClientStreaming
,ClientStreamingMethodHandlerSupplier.ClientStreamingIterable
,ClientStreamingMethodHandlerSupplier.ClientStreamingStream
,ClientStreamingMethodHandlerSupplier.FutureResponse
,ServerStreamingMethodHandlerSupplier.AbstractServerStreamingHandler
,ServerStreamingMethodHandlerSupplier.ServerStreaming
,ServerStreamingMethodHandlerSupplier.ServerStreamingNoRequest
,ServerStreamingMethodHandlerSupplier.StreamResponse
,ServerStreamingMethodHandlerSupplier.StreamResponseNoRequest
,UnaryMethodHandlerSupplier.AbstractUnaryHandler
,UnaryMethodHandlerSupplier.FutureResponse
,UnaryMethodHandlerSupplier.FutureResponseNoRequest
,UnaryMethodHandlerSupplier.NoRequestNoResponse
,UnaryMethodHandlerSupplier.RequestNoResponse
,UnaryMethodHandlerSupplier.RequestResponse
,UnaryMethodHandlerSupplier.ResponseOnly
,UnaryMethodHandlerSupplier.Unary
,UnaryMethodHandlerSupplier.UnaryFuture
,UnaryMethodHandlerSupplier.UnaryFutureNoRequest
,UnaryMethodHandlerSupplier.UnaryNoRequest
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
Modifier and TypeInterfaceDescriptionstatic interface
A bidirectional client call handler.static interface
A client streaming client call handler.static interface
A server streaming client call handler.static interface
A unary client call handler. -
Method Summary
Modifier and TypeMethodDescriptiondefault Object
bidirectional
(Object[] args, MethodHandler.BidirectionalClient client) Handle a bi-directional client call.default boolean
Determine whether this is a client side only handler.default Object
clientStreaming
(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 void
Obtain the name of the underlying Java method that this handler maps to.default Object
serverStreaming
(Object[] args, MethodHandler.ServerStreamingClient client) Handle a bi-directional client call.io.grpc.MethodDescriptor.MethodType
type()
Obtain thegRPC method tyoe
that thisMethodHandler
handles.default Object
unary
(Object[] args, MethodHandler.UnaryClient client) Handle a bi-directional client call.
-
Method Details
-
type
io.grpc.MethodDescriptor.MethodType type()Obtain thegRPC method tyoe
that thisMethodHandler
handles.- Returns:
- the
gRPC method type
that thisMethodHandler
handles
-
getRequestType
Class<?> getRequestType()Obtain the request type.- Returns:
- the request type
-
getResponseType
Class<?> getResponseType()Obtain the response type.- Returns:
- the response type
-
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:
true
if 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.BidirectionalClient
instance to forward the call to.- Returns:
- the call result
-
clientStreaming
Handle a bi-directional client call.- Parameters:
args
- the call arguments.client
- theMethodHandler.ClientStreaming
instance to forward the call to.- Returns:
- the call result
-
serverStreaming
Handle a bi-directional client call.- Parameters:
args
- the call arguments.client
- theMethodHandler.ServerStreamingClient
instance to forward the call to.- Returns:
- the call result
-
unary
Handle a bi-directional client call.- Parameters:
args
- the call arguments.client
- theMethodHandler.UnaryClient
instance to forward the call to.- Returns:
- the call result
-