Remote Method Invocation
Java hides the difference between local and Remote Method Invocation from the user.
After marshaling the type of object, it passed as a parameter to RMI in Java.
- The reference to Remote Method Invocation object consists of the network address and endpoint of the server.
- It also contains the local ID for the actual object in the server address space.
- Each object in Java is an instance of a class, which contains the implementation of one or more interfaces.
- A java remote object built from two classes (i) server class and (ii) client class.
- This class contains the implementation of the server-side code, i.e objects which run on the server.
- It also consists of a description of the object state and implementation of methods which operate on that state.
- The skeleton on the server side stub generated from the interface specification of the object.
- This class contains the implementation of client-side code and proxy.
- It generated from the object interface specification.
- The proxy basically converts each method call into the message that sent to the server-side implementation of the remote object.
- Communication set up to the server and cut down when a call complete.
- The proxy state contains the server’s network address, the end of the server and local ID of the object.
- Hence, a proxy consists of sufficient information to invoke the methods of a remote object.
- Proxies serializable in Java marshaled and sent a series of bytes to another process where it unmarshalled and can invoke methods on remote objects.