RMI - Remote Method Invocation






Terminology

A remote object is an object whose methods may be called by a different virtual machine than the one where the object itself lives, generally one running on a different computer. Each remote object implements one or more remote interfaces that declare which methods of the remote object the foreign system can invoke.

RMI and RPC




On the OSI Model:


Transparency Issues:



RMI Specifics


About the Naming Registry Service:

As described in "Java Network Programming", by Hughes, Schnoffner, and Winslow, 1997, pp.419-420:

Clients can invoke methods on remote objects only if they have a reference to the object. A simple name server is provided in the RMI model for this purpose. Remote objects register themselves using the java.rmi.Naming class, which uses a URL-based scheme. An implementation of a naming registry is supplied with the RMI distribution. Under JDK1.1, it is provided with the rmiregistry command. It requires no subclassing and is run before the remote object or clients are started.

Clients use the java.rmi.Naming class to look up and obtain remote to objects. The address of the remote object is specified with a URL that indicates the remote machine and the name of the object on the machine. When an object registers itself with the registry, it specifies a name by which it can be referenced. Remote clients will connect to the registry and locate the object based on this name.

Sun's RMI documentation tells you everything you wanted to know about RMI and more!




Requirements

Checklist of Steps



Example 1: HelloServImpl.java HelloInterface.java HelloClient.java


Example 2: WeatherServImpl.java WeatherIntf.java WeatherClient.java