Interface MethodHandlerSupplier
-
- All Known Implementing Classes:
BidirectionalMethodHandlerSupplier,ClientStreamingMethodHandlerSupplier,ServerStreamingMethodHandlerSupplier,UnaryMethodHandlerSupplier
public interface MethodHandlerSupplierA supplier ofMethodHandlers forAnnotatedMethods.Implementation classes may be annotated with
Priorityto influence their priority order when determining which supplier is used if more than one supplier is able to supply a handler for a method. The built-in default suppliers have a priority of zero, which is also the default priority for classes that are not annotated.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <ReqT,RespT>
MethodHandler<ReqT,RespT>get(String methodName, AnnotatedMethod method, Supplier<?> instance)Supply aMethodHandlerfor a method.booleansupplies(AnnotatedMethod method)Determine whether thisMethodHandlerSuppliercan supply aMethodHandlerfor a given method and type.
-
-
-
Method Detail
-
supplies
boolean supplies(AnnotatedMethod method)
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<?> instance)
Supply aMethodHandlerfor a method.- Type Parameters:
ReqT- the request typeRespT- the response type- Parameters:
methodName- the gRPC method namemethod- the method to supply aMethodHandlerforinstance- the supplier to supply the actual call handler- Returns:
- a
MethodHandlerfor the method - Throws:
NullPointerException- if the method is null
-
-