|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RpcChannel
Abstract interface for an RPC channel. An RpcChannel
represents a
communication line to a Service
which can be used to call that
Service
's methods. The Service
may be running on another
machine. Normally, you should not call an RpcChannel
directly, but
instead construct a stub Service
wrapping it. Example:
RpcChannel channel = rpcImpl.newChannel("remotehost.example.com:1234"); RpcController controller = rpcImpl.newController(); MyService service = MyService.newStub(channel); service.myMethod(controller, request, callback);
Method Summary | |
---|---|
void |
callMethod(Descriptors.MethodDescriptor method,
RpcController controller,
Message request,
Message responsePrototype,
RpcCallback<Message> done)
Call the given method of the remote service. |
Method Detail |
---|
void callMethod(Descriptors.MethodDescriptor method, RpcController controller, Message request, Message responsePrototype, RpcCallback<Message> done)
Service.callMethod()
with one important difference: the caller
decides the types of the Message
objects, not the callee. The
request may be of any type as long as
request.getDescriptor() == method.getInputType()
.
The response passed to the callback will be of the same type as
responsePrototype
(which must have
getDescriptor() == method.getOutputType()
).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |