Interface MethodHandlerSupplier
- All Known Implementing Classes:
BidirectionalMethodHandlerSupplier
,ClientStreamingMethodHandlerSupplier
,ServerStreamingMethodHandlerSupplier
,UnaryMethodHandlerSupplier
public interface MethodHandlerSupplier
A supplier of
MethodHandler
s for AnnotatedMethod
s.
Implementation classes may be annotated with Weight
to influence their order when determining which supplier is used if
more than one supplier is able to supply a handler for a method.
-
Method Summary
Modifier and TypeMethodDescription<ReqT,
RespT>
MethodHandler<ReqT, RespT> get
(String methodName, AnnotatedMethod method, Supplier<?> instanceSupplier) Supply aMethodHandler
for a method.boolean
supplies
(AnnotatedMethod method) Determine whether thisMethodHandlerSupplier
can supply aMethodHandler
for a given method and type.
-
Method Details
-
supplies
Determine whether thisMethodHandlerSupplier
can supply aMethodHandler
for a given method and type.- Parameters:
method
- theAnnotatedMethod
to supply a handler for- Returns:
true
if this supplier can supply a handler for the method
-
get
<ReqT,RespT> MethodHandler<ReqT,RespT> get(String methodName, AnnotatedMethod method, Supplier<?> instanceSupplier) Supply aMethodHandler
for a method.- Type Parameters:
ReqT
- the request typeRespT
- the response type- Parameters:
methodName
- the gRPC method namemethod
- the method to supply aMethodHandler
forinstanceSupplier
- the supplier to supply the actual call handler- Returns:
- a
MethodHandler
for the method - Throws:
NullPointerException
- if the method is null
-