public final class ServerMethodDefinition<RequestT,ResponseT> extends Object
HandlerRegistry
and exposed
by a Server
.Modifier and Type | Method and Description |
---|---|
static <RequestT,ResponseT> |
create(MethodDescriptor<RequestT,ResponseT> method,
ServerCallHandler<RequestT,ResponseT> handler)
Create a new instance.
|
MethodDescriptor<RequestT,ResponseT> |
getMethodDescriptor()
The
MethodDescriptor for this method. |
ServerCallHandler<RequestT,ResponseT> |
getServerCallHandler()
Handler for incoming calls.
|
ServerMethodDefinition<RequestT,ResponseT> |
withServerCallHandler(ServerCallHandler<RequestT,ResponseT> handler)
Create a new method definition with a different call handler.
|
public static <RequestT,ResponseT> ServerMethodDefinition<RequestT,ResponseT> create(MethodDescriptor<RequestT,ResponseT> method, ServerCallHandler<RequestT,ResponseT> handler)
method
- the MethodDescriptor
for this method.handler
- to dispatch calls to.public MethodDescriptor<RequestT,ResponseT> getMethodDescriptor()
MethodDescriptor
for this method.public ServerCallHandler<RequestT,ResponseT> getServerCallHandler()
public ServerMethodDefinition<RequestT,ResponseT> withServerCallHandler(ServerCallHandler<RequestT,ResponseT> handler)
handler
- to bind to a cloned instance of this.