Remote Method Invocation

Why Trust Techopedia

What Does Remote Method Invocation Mean?

Remote method invocation (RMI) is a distributed object technology developed by Sun for the Java programming language. It is available as part of the core Java application programming interface (API) where the object interfaces are defined as Java interfaces and use object serialization.

Advertisements

RMI permits Java methods to refer to a remote object and invoke methods of the remote object. The remote object may reside on another Java virtual machine, the same host or on completely different hosts across the network. RMI marshals and unmarshals method arguments through object serialization and supports dynamic downloading of class files across networks.

Techopedia Explains Remote Method Invocation

Remote method invocation was first introduced in Java Development Kit (JDK) 1.1 and is extensively used in distributed object computing. It performs the object-oriented equivalence of remote procedure calls. RMI functionalities come in a java.rmi package and provide a distributed object capability for Java-based applications.

RMI architecture extends the robustness and safety of Java architecture to the distributed computing world. RMI allows the that code defines and implements the behavior to remain on different Java virtual machines. Remote services in RMI are coded using a Java interface where the implementation is coded in a class. In the first class, implementation of the behavior runs on the server. The second class runs on the client and acts as a proxy for the remote service.

RMI implementation is built from three abstract layers – the stub and skeleton layer, the remote reference layer and the transport layer. The stub and skeleton layer is just below the view of the developer. Stub and skeleton objects are used to provide a connection between the client and remote object. A stub forwards method invocations from the client to the server and is aware of how to communicate with the stub across the link. Therefore, it acts as a proxy where the remote object implementation resides. Reference to the remote object by a client is literally a reference to the local stub. The client houses a local copy of the stub object. Skeletons hold methods, which dispatch calls to remote object implementation.

The steps in designing an RMI application are:

  1. Define remote interfaces and implement client and remote objects.
  2. Compile the source and generate stubs and skeletons.
  3. Make required class networks accessible.
  4. Run the application.
Advertisements

Related Terms

Margaret Rouse
Editor

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…