This blog is about providing theory as well as simple executable codes of different programming languages such as java, C, C++, and web programming, etc. This blog will be helpful to the IT students to learn about programming.

Thursday, March 2, 2023

What is the importance of Stub and Skeleton? Explain RMI architecture with a block diagram.

 In Remote Method Invocation (RMI) technology, Stub and Skeleton are two important components that facilitate communication between remote objects.

The Stub and Skeleton work together to provide a transparent mechanism for remote method invocation. The client-side Stub hides the details of the network communication and marshalling of method arguments, while the server-side Skeleton hides the details of the method dispatching and unmarshalling of method arguments.

RMI Architecture:

The RMI architecture consists of four main components: the Remote Interface, the Remote Object, the RMI Registry, and the Client.

  1. Remote Interface: A Java interface that defines the methods that can be invoked remotely by clients. The Remote Interface extends the java.rmi.Remote interface and each method must throw a java.rmi.RemoteException to indicate that it can generate a remote exception.
  2. Remote Object: A Java object that implements the Remote Interface and provides the implementation for the remote methods. The Remote Object extends the java.rmi.server.UnicastRemoteObject class to export its methods for remote invocation.
  3. RMI Registry: A registry that allows clients to look up remote objects by name. The RMI Registry is implemented as a server that listens for incoming requests from clients.
  4. Client: A Java application that invokes remote methods on remote objects. The Client uses the RMI Registry to obtain a reference to a remote object and then invokes its methods as if they were local methods.

The following block diagram shows the RMI architecture:


fig: RMI Architecture

No comments:

Post a Comment

If you have any doubts, please let me know

Slider Widget