rpcfy.annotations.package-info Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rpcfy-annotations Show documentation
Show all versions of rpcfy-annotations Show documentation
RPCfy upgrades your normal java interface to be capable of doing RPC (Remote Procedure Call).
/**
*
* RPCfy upgrades your normal java interface to be capable of doing RPC (Remote Procedure Call).
*
*
*
* Example -
*
*
*
*
* {@literal @}RPCfy
* public interface ISampleService {
*
* }
*
*
*
* At the client side :
*
*
*
Use the auto-generated proxy
* Provide the transport to send/receive message
* Pass the received messages to the JsonRPCMessageHandler
*
* 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 :
*
*
*
Implement your interface
* Wrap your implementation with the auto-generated Stub
* Provide the transport to send/receive message
* Pass the received messages to the JsonRPCMessageHandler
*
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);
*
*
*
*/
package rpcfy.annotations;
© 2015 - 2024 Weber Informatics LLC | Privacy Policy