The benefits of exposing DistributeMe service using JSON is that it be more easily to do tunneling then RMI.
The flow of exposing service can be as following:
A) Client look up Registry for target service;
B) Registry return target service descriptor;
C) Client uses service descriptor details to connect HTTP endpoint and send JSON request;
D) Service generate JSON response and send to client;
E) Client connect HTTP service endpoint using existing reference;
F) Serivce generate JSON response and send it back to client;
In this case standalone service should act as HTTP endpoint to handle JSON calls.
As basis for communication JSON-RPC standard could be used.
More details at:
Following HTTP server implementations can be used as embedded HTTP server:
- JDK 1.6 Embedded HTTP server
Used in JaxWS endpoint implementation.
Can be used as Servlet container
Following JSON-RPC 2.0 implementation could be used.