See: Description
Annotation Type | Description |
---|---|
RPCfy |
Marks an interface to be RPCfy'ed
|
RPCfyNotSupported |
Marks a method within an interface marked as @
RPCfy as not supporting RPC |
RPCfy upgrades your normal java interface to be capable of doing RPC (Remote Procedure Call).
@RPCfy
public interface ISampleService {
}
At the client side :
MessageSender clientMessageSender;//You provide the transport
JsonRPCMessageHandler messageHandler = new JsonRPCMessageHandler(clientMessageSender);
IEchoService echoService = new IEchoService_JsonRpcProxy(messageHandler);
//When you receive messages from server, pass it to messageHandler
messageHandler.onMessage(messageFromServer);
At the service side :
MessageSender serverMessageSender;//You provide the transpor
JsonRPCMessageHandler messageHandler = new JsonRPCMessageHandler(serverMessageSender);
IEchoService yourService = new EchoService(); //Your service implementation
messageHandler.registerStub(new IEchoService_JsonRpcStub(messageHandler, yourService));
//When you receive messages from client, pass it to messageHandler
messageHandler.onMessage(messageFromServer);