Interface MethodHandlerSupplier
- All Known Implementing Classes:
BidirectionalMethodHandlerSupplier,ClientStreamingMethodHandlerSupplier,ServerStreamingMethodHandlerSupplier,UnaryMethodHandlerSupplier
public interface MethodHandlerSupplier
A supplier of
MethodHandlers for AnnotatedMethods.
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 aMethodHandlerfor a method.booleansupplies(AnnotatedMethod method) Determine whether thisMethodHandlerSuppliercan supply aMethodHandlerfor a given method and type.
-
Method Details
-
supplies
Determine whether thisMethodHandlerSuppliercan supply aMethodHandlerfor a given method and type.- Parameters:
method- theAnnotatedMethodto supply a handler for- Returns:
trueif this supplier can supply a handler for the method
-
get
<ReqT,RespT> MethodHandler<ReqT,RespT> get(String methodName, AnnotatedMethod method, Supplier<?> instanceSupplier) Supply aMethodHandlerfor a method.- Type Parameters:
ReqT- the request typeRespT- the response type- Parameters:
methodName- the gRPC method namemethod- the method to supply aMethodHandlerforinstanceSupplier- the supplier to supply the actual call handler- Returns:
- a
MethodHandlerfor the method - Throws:
NullPointerException- if the method is null
-