Package com.google.protobuf
Interface RpcChannel
-
public interface RpcChannelAbstract interface for an RPC channel. AnRpcChannelrepresents a communication line to aServicewhich can be used to call thatService's methods. TheServicemay be running on another machine. Normally, you should not call anRpcChanneldirectly, but instead construct a stubServicewrapping it. Example:RpcChannel channel = rpcImpl.newChannel("remotehost.example.com:1234"); RpcController controller = rpcImpl.newController(); MyService service = MyService.newStub(channel); service.myMethod(controller, request, callback);Starting with version 2.3.0, RPC implementations should not try to build on this, but should instead provide code generator plugins which generate code specific to the particular RPC implementation. This way the generated code can be more appropriate for the implementation in use and can avoid unnecessary layers of indirection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcallMethod(Descriptors.MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, RpcCallback<Message> done)Call the given method of the remote service.
-
-
-
Method Detail
-
callMethod
void callMethod(Descriptors.MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, RpcCallback<Message> done)
Call the given method of the remote service. This method is similar toService.callMethod()with one important difference: the caller decides the types of theMessageobjects, not the callee. The request may be of any type as long asrequest.getDescriptor() == method.getInputType(). The response passed to the callback will be of the same type asresponsePrototype(which must havegetDescriptor() == method.getOutputType()).
-
-