java remote invoke
Since IPC
was first mentioned, many methods and protocals that involving inter-process call
published, like RPC
, Web Service
etc.,
But actually, those are all another format of IPC
, the difference is the processes
that will be invoked is remote or local.
Here I want to make a summary, especially in Java:
RPC is a kind of IPC
When program statements that use RPC are compiled into an executable program, a stub is included in the compiled code that acts as the representative of the remote procedure code.
When the program is run and the procedure call is issued, the stub receives the request and forwards it to a client runtime program in the local computer. The client runtime program has the knowledge of how to address the remote computer and server application and sends the message across the network that requests the remote procedure.
Similarly, the server includes a runtime program and stub that interface with the remote procedure itself. Results are returned the same way.
JMI
Java also provide such kind of remote invocation, JMI
means to invoke a Java method in remote side. This technique are used in EJB
suite, which ius treated as a very heavy method.
Web Service
With the introduction of Web Service
, developers enable to remotely invoke method in a easy way.
Java Web Service
- big web service:
JAX-WS
:javax.xml.ws
SOAP
(An XML architecture) based.- Using
JAX-WS
to determineJava-to-WSDL
Mapping. - Publish
WSDL
as syntactical definition interface.
- RESTful web service:
JAX-RS
- HTTP based.
- Using
JAX-RS
to easy binding. - Far lightweight and easy integrating.