Top Description Fields Constructors Methods
io.grpc

public final Class ServerMethodDefinition<ReqT, RespT>

extends Object
Class Inheritance

Definition of a method exposed by a Server.
See Also
ServerServiceDefinition

Field Summary

Modifier and TypeField and Description
private final ServerCallHandler<ReqT, RespT>
private final MethodDescriptor<ReqT, RespT>

Constructor Summary

AccessConstructor and Description
private
ServerMethodDefinition(MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler)

Method Summary

Modifier and TypeMethod and Description
public static <ReqT, RespT> ServerMethodDefinition<ReqT, RespT>

Returns:

a new instance.
create
(MethodDescriptor<ReqT, RespT>
the MethodDescriptor for this method.
method
,
ServerCallHandler<ReqT, RespT>
to dispatch calls to.
handler
)

Create a new instance.

public MethodDescriptor<ReqT, RespT>
getMethodDescriptor()

The MethodDescriptor for this method.

public ServerCallHandler<ReqT, RespT>
getServerCallHandler()

Handler for incoming calls.

public ServerMethodDefinition<ReqT, RespT>

Returns:

a cloned instance of this with the new handler bound.
withServerCallHandler
(ServerCallHandler<ReqT, RespT>
to bind to a cloned instance of this.
handler
)

Create a new method definition with a different call handler.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

handlerback to summary
private final ServerCallHandler<ReqT, RespT> handler
methodback to summary
private final MethodDescriptor<ReqT, RespT> method

Constructor Detail

ServerMethodDefinitionback to summary
private ServerMethodDefinition(MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler)

Method Detail

createback to summary
public static <ReqT, RespT> ServerMethodDefinition<ReqT, RespT> create(MethodDescriptor<ReqT, RespT> method, ServerCallHandler<ReqT, RespT> handler)

Create a new instance.

Parameters
method:MethodDescriptor<ReqT, RespT>

the MethodDescriptor for this method.

handler:ServerCallHandler<ReqT, RespT>

to dispatch calls to.

Returns:ServerMethodDefinition<ReqT, RespT>

a new instance.

getMethodDescriptorback to summary
public MethodDescriptor<ReqT, RespT> getMethodDescriptor()

The MethodDescriptor for this method.

getServerCallHandlerback to summary
public ServerCallHandler<ReqT, RespT> getServerCallHandler()

Handler for incoming calls.

withServerCallHandlerback to summary
public ServerMethodDefinition<ReqT, RespT> withServerCallHandler(ServerCallHandler<ReqT, RespT> handler)

Create a new method definition with a different call handler.

Parameters
handler:ServerCallHandler<ReqT, RespT>

to bind to a cloned instance of this.

Returns:ServerMethodDefinition<ReqT, RespT>

a cloned instance of this with the new handler bound.