Package io.grpc
Class ServerMethodDefinition<ReqT,RespT>
java.lang.Object
io.grpc.ServerMethodDefinition<ReqT,RespT>
Definition of a method exposed by a
Server
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <ReqT,
RespT>
ServerMethodDefinition<ReqT, RespT> create
(MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) Create a new instance.TheMethodDescriptor
for this method.Handler for incoming calls.withServerCallHandler
(ServerCallHandler<ReqT, RespT> handler) Create a new method definition with a different call handler.
-
Method Details
-
create
public static <ReqT,RespT> ServerMethodDefinition<ReqT,RespT> create(MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler) Create a new instance.- Parameters:
method
- theMethodDescriptor
for this method.handler
- to dispatch calls to.- Returns:
- a new instance.
-
getMethodDescriptor
TheMethodDescriptor
for this method. -
getServerCallHandler
Handler for incoming calls. -
withServerCallHandler
public ServerMethodDefinition<ReqT,RespT> withServerCallHandler(ServerCallHandler<ReqT, RespT> handler) Create a new method definition with a different call handler.- Parameters:
handler
- to bind to a cloned instance of this.- Returns:
- a cloned instance of this with the new handler bound.
-