This chapter examines the Java Remote Method Invocation (RMI) API—Java’s native scheme for creating and using remote objects. Java RMI provides the following elements:
Support (API and runtime) for remote object implementations
Support for client interfaces, or stubs , to remote objects
A remote object registry for finding objects on the network
A facility for automatically creating (activating) remote objects on demand
A network protocol for communication between remote objects and their clients
Each of these elements has related Java interfaces within the
java.rmi package and its subpackages
and runtime support for the feature as part of the JVM services. Using
these interfaces and runtime services, you can develop remote objects
and the clients that use them as part of a distributed application that
resides on hosts across the network.
This chapter covers the RMI API and runtime included in the JDK 1.5 (otherwise known as J2SE 5.0). In key areas, we’ll highlight features or behavior that varies in earlier versions of the JDK. The most notable RMI feature introduced in JDK 1.5 is the dynamic generation of client stubs for RMI remote objects. This makes the use of the RMI compiler optional since stub classes can now be generated on demand at runtime by the JVM. If your distributed system includes clients running in 1.4 or older JVMs, however, you’ll still need to generate stub classes with the RMI compiler so that these clients ...