Java remote method invocation

Remote Method Invocation ( RMI German about " calling remote methods " ), sometimes referred to as remote method invocation, the invocation of a method of a remote Java object and implements the Java own way of Remote Procedure Call. " Remote" means that the object can be located in a different Java Virtual Machine, which in turn can run on a remote computer or on the local computer. It (the programmer or ) the call for the calling object looks the same as a local call, but it must be intercepted specific exceptions that can signal a disconnect for example.

On the client side, the so-called stub takes care of the network transport. The stub must be available either locally or over the network to the client. Prior to the advent of the Java 2 Standard Edition ( J2SE) version 1.5.0 of the stub was produced by the RMI compiler rmic class. Since version 1.5 it is no longer necessary, the RMI compiler rmic call. Creating the stubs is handled by the Java Virtual Machine.

Although distant objects may also be provided by a well-known already in the program the remote object, but for the first connection the server address and an identifier ( an RMI URL) are required. The identifier provides a name service on the server returns a reference to the remote object. For this to work, the remote object in the server must have previously registered under this name with the name service. The RMI naming service is accessed through static methods of the class java.rmi.Naming. The name service is implemented as a standalone program and RMI registry is called.

Communication protocol

RMI also referred to a system based on TCP / IP and JRMP communication protocol that is used for remote calls between Java objects, and a standard Java class library with which these calls can be realized. This class library is part of J2SE. Alternatively, IIOP can be used as the communication protocol. For RMI two ports are reserved. Port 1099 is reserved for the RMI registry, thus the name service. Port 1098 is reserved for the Activator.

Components

Expiration

Activation

As a complement of RMI is the so-called activation ( "activation" ) is available. Similarly, the RMI registry, this is also a focal point for RMI clients. However, the Activator can also generate RMI server objects and start a new Virtual Machine.

677626
de