1.

Does Java support Remote Method Invocation (RMI)?

Answer»

The Remote Method Invocation is an API in Java which manages the creation of a distributed application by ALLOWING an object to invoke a method on another object that may be on the same machine or another remote machine but is on another address space.

The communication between the CLIENT and server in RMI is done by using the stub object and the skeleton object that are on the client SIDE and server side respectively.

Details about the stub object and the skeleton object are provided along with the FOLLOWING DIAGRAM:

  • Stub object: All the outgoing requests for the client side are routed through the stub object and so it is also known as the gateway for the client-side object.
  • Skeleton Object: All the incoming requests for the server side are routed through the skeleton object and so it is also known as the gateway for the server-side object.

The steps to create a Remote Method Invocation program are given as follows:

  1. First the remote interface is created.
  2. The implementation of the remote interface is provided.
  3. The implementation class is compiled and the stub and skeleton objects are created.
  4. The registry service is started using the rmiregistry tool.
  5. The remote application is created and started.
  6. The client application is created and started.


Discussion

No Comment Found