Java RMI - client call to server

Trying to understand how RMI works (I have a simple application that uses RMI and seems to work fine).

My question is: what happens when rmi is called? What happens on the way from the rmi client to the rmi server?

+4
source share
2 answers

after the search described above, the objects used as parameters in the rmi call are serialized (Marshalling), which means that the byte representation of the objects with non-transient data will be transmitted over the network connection. On the server side, serialized data will be unarmored and objects will be created. After that, the server-side method is called, the returned values ​​are returned in the same way as the parameters were previously sent. It is like writing an object to a file.

http://java.sun.com/j2se/1.4.2/docs/guide/rmi/faq.html

+3
source

RMI is an object-oriented approach for RPC.

On the client side, there is a Stub and a Skeleton on the server side. The client and server do not directly exchange data, but they exchange data via Stub and Skeleton, which are automatically generated.

As you can guess, there must be some objects that the server and client should use. These objects are defined on the server side and are stored in the RMI Registry . Both the server and the client can call the RMI registry and somehow it works like memory (this is not memory, this is an example that should be clear). The server associates the object with the registry, and the client calls methods on it.

+2
source

All Articles