Search code examples
javarmi

Java RMI - client to server call


Trying to get an understanding on how the RMI is working (I have a simple application that uses RMI and seems to work just fine).

My question is : What happens when an rmi call is made? What happens on the way from an rmi client to an rmi server?


Solution

  • after the lookup described above, the objects used as parameters in a rmi call are serialized (Marshalling) that means a byte by byte representation of the objects non transient data will be send over the network connection. On server-side the serialized data will be unmarshalled and the objects will be instantiated. After that the server-side method is invoked, return values will be returned in a similar way as parameters have been previously send. It is similar to writing an object into a file.

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