The RMI application contains the THREE components
(1) RMI Server
(2) RMI Client
(3) RMI Registry
(1) RMI Server:
RMI Server contains objects whose methods are to be called remotely. It creates remote objects and applies the reference to these objects in the Registry, after that the Registry registers these objects who are going to be called by client remotely.
(2) RMI Client:
The RMI Client gets the reference of one or more remote objects from Registry with the help of object name. Now, it can be invokes the methods on the remote object to access the services of the objects as per the requirement of logic in RMI application.
Once the client gets the reference of remote object, the methods in the remote object are invoked just like as the methods of a local object.
(3) RMI Registry:
In the Server side the reference of the object (which is invoked remotely) is applied and after that this reference is set in the RMI registry.
When the Client call the method on this object, it’s not directly call but it call by the reference which is already set in the Registry so first get the object from this reference which is available at RMI Registry then after calls the methods as per the requirement of logic in RMI application.