22.214.171.124. Java RMI: Java-to-Java remote objects
Remote method invocation (RMI) is a programming model that provides a high-level,
generic approach to distributed computing. RMI extends the Java object-oriented
programming paradigm to distributed client/server programming: it allows a client to
communicate with a server by invoking methods on remote objects that reside on the
server. RMI is implemented in the java.rmi package and its subpackages, which were
introduced in Java 1.1 and were enhanced in later versions of the Java platform.
The Java RMI implementation is full-featured but still simple and easy to use. It gains
much of its simplicity by requiring both client and server to be implemented in Java. This
requirement ensures that both client and server share a common set of data types and have
access to the object serialization and deserialization features of the java.io package, for
example. On the other hand, this means that it is more difficult to use RMI with distributed
objects written in languages other than Java, such as objects that exist on legacy servers.
The default remote method communication protocol used by RMI will allow only Java
code to interact with RMI objects. But you can also opt to use RMI/IIOP, which was made
a standard part of the core Java APIs in Version 1.3 of the Java platform. RMI/IIOP is an
optional communication protocol that allows RMI objects to interact with CORBA-based
remote objects. Since CORBA objects can be implemented in many languages, this
provides a bridge to systems implemented in other languages.
The java.rmi package makes it easy to create networked, object-oriented programs.
Programmers who have spent time writing networked applications using lower-level
protocols are usually amazed by the power of RMI. See Chapter 13 for a tutorial on using