Skip navigation links

Package rpcfy.annotations

RPCfy upgrades your normal java interface to be capable of doing RPC (Remote Procedure Call).

See: Description

Package rpcfy.annotations Description

RPCfy upgrades your normal java interface to be capable of doing RPC (Remote Procedure Call).



Example -



  @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);


Skip navigation links