Package io.grpc
Class ServerMethodDefinition<ReqT,RespT>
- java.lang.Object
-
- io.grpc.ServerMethodDefinition<ReqT,RespT>
-
public final class ServerMethodDefinition<ReqT,RespT> extends Object
Definition of a method exposed by aServer.- See Also:
ServerServiceDefinition
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <ReqT,RespT>
ServerMethodDefinition<ReqT,RespT>create(MethodDescriptor<ReqT,RespT> method, ServerCallHandler<ReqT,RespT> handler)Create a new instance.MethodDescriptor<ReqT,RespT>getMethodDescriptor()TheMethodDescriptorfor this method.ServerCallHandler<ReqT,RespT>getServerCallHandler()Handler for incoming calls.ServerMethodDefinition<ReqT,RespT>withServerCallHandler(ServerCallHandler<ReqT,RespT> handler)Create a new method definition with a different call handler.
-
-
-
Method Detail
-
create
public static <ReqT,RespT> ServerMethodDefinition<ReqT,RespT> create(MethodDescriptor<ReqT,RespT> method, ServerCallHandler<ReqT,RespT> handler)
Create a new instance.- Parameters:
method- theMethodDescriptorfor this method.handler- to dispatch calls to.- Returns:
- a new instance.
-
getMethodDescriptor
public MethodDescriptor<ReqT,RespT> getMethodDescriptor()
TheMethodDescriptorfor this method.
-
getServerCallHandler
public ServerCallHandler<ReqT,RespT> 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.
-
-