User manual
Contents
Preliminaries
RMI programming
Compiling and running
Preliminaries
After having installed the NexusRMI system you can start compiling and running
RMI applications. Before that, you may need to make sure the following shell
variables are set correctly:
- PATH should include the BIN_DIR specified in the installation
procedure. This is necessary in order to find the compilers and other executables.
- CLASSPATH should include the RTS_DIR specified in the installation
procedure. This is necessary in order to find the Nexus and NexusRMI runtime system.
Back to contents.
RMI programming
You are now ready to write an RMI application. See Sun's
RMI homepage for a
tutorial and examples of RMI applications. Most RMI applications should run without
modifications with NexusRMI. Beware, however, that NexusRMI only implements a subset
of the JavaRMI functionality. See future work for features
that are not (yet) supported. In NexusRMI, the object serialization protocol can be
specified on a per remote object basis. How to exploit this feature is described
here.
Back to contents.
Compiling and running
To compile your RMI application against NexusRMI, your application needs to import
from the nexusrmi package instead of from the java.rmi package.
Basically, this comes down to changing every fully qualified name of an RMI object
and changing all import-statements for RMI classes. For instance:
java.rmi.server.UnicastRemoteObject
becomes
nexusrmi.server.UnicastRemoteObject
.
For convenience, the scripts java2nexus and
nexus2java will transform your application to use
NexusRMI and JavaRMI respectively. Use this script with caution, however, since it
will indiscriminately replace all occurrences without regarding any context.
Changing these fully qualified class names should be the only change to your source
code required. Next step is to compile all your Java source files with your favorite
Java compiler. This compilation step must be done first, since nexusrmis and
nexusrmic may require the class files generated in this step (as does the
original rmic).
Next step is to identify all classes that implement the interface
java.io.Serializable. These classes must be transformed by
nexusrmis to support the actual serialization process.
For instance, if both MyClass and MyList implement
java.io.Serializable, the following command must be run:
nexusrmis MyClass.java MyList.java
Currently, it is not possible to pass system classes that implement
java.iu.Serializable, because these do not contain the necessary traversal
routines. The classes java.lang.String, java.lang.Class, and
java.lang.Vector have direct support for serialization in NexusRMI, so
only these system classes can be passed as parameter or return value.
The last step is to generate stub and skeleton classes for all remote objects. The
stub / skeleton compiler in NexusRMI is nexusrmic
If MyRemote is a remote class, the stub and skeleton classes are generated
by the following command:
nexusrmic MyRemote
Running the code is no different than running JavaRMI applications, except that the
registry is run by nexusrmiregistry.
Back to contents.
Fabian Breg
Last modified: Sat Oct 17 14:30:01 EST 1998