Interface MethodHandlerSupplier
-
- All Known Implementing Classes:
BidirectionalMethodHandlerSupplier
,ClientStreamingMethodHandlerSupplier
,ServerStreamingMethodHandlerSupplier
,UnaryMethodHandlerSupplier
public interface MethodHandlerSupplier
A supplier ofMethodHandler
s forAnnotatedMethod
s.Implementation classes may be annotated with
Priority
to 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 aMethodHandler
for a method.boolean
supplies(AnnotatedMethod method)
Determine whether thisMethodHandlerSupplier
can supply aMethodHandler
for a given method and type.
-
-
-
Method Detail
-
supplies
boolean supplies(AnnotatedMethod method)
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<?> instance)
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
forinstance
- the supplier to supply the actual call handler- Returns:
- a
MethodHandler
for the method - Throws:
NullPointerException
- if the method is null
-
-