RMI (Remote Method Invocation)

  1. server program (resides on the server)- a remote object is created and reference of that object is made available for the client (using the registry).
  2. client program (resides on the client)- requests the remote objects on the server and tries to invoke its methods.

RMI Architecture

  • Transport Layer − Connection between client and server. It controls the existing connection and new connections.
  • Stub − A stub is a representation (proxy) of the remote object at client. It resides in the client system; it acts as a gateway for the client program.
  • Skeleton − This is the object which resides on the server side. stub communicates with this skeleton to pass request to the remote object.
  • RRL(Remote Reference Layer) − It is the layer which manages the references made by the client to the remote object.

Requirements for the distributed application

The is given the 6 steps to write the RMI program

  1. Create the remote interface
  2. Provide the implementation of the remote interface
  3. Compile the implementation class and create the stub and skeleton objects using the rmic tool
  4. Start the registry service by rmi registry tool
  5. Create and start the remote application
  6. Create and start the client application

Step 5

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store