last modified: January 15 2001
The jrmic compiler
Introduction
The Jonathan jrmic compiler generates the java stubs and skeletons
necessary to run distributed objects on the RMI/IIOP personality of the Jonathan
ORB platform (David RMI). Class files are
generated for remote objects from the names of compiled Java classes that contain
remote object implementations (a remote object is one that implements the
interface java.rmi.Remote). The classes named in the jrmic
command must be classes that have been compiled successfully with the javac
command and must be fully package qualified. For example, running jrmic
on the class file name HelloImpl as shown here:
jrmic hello.HelloImpl
creates the HelloImpl_Skel.class
and HelloImpl_Stub.class files.
A skeleton for a remote object is a server-side entity that contains
a method which dispatches calls to the actual remote object implementation.
A stub is a proxy for a remote object which is responsible for forwarding
method invocations on remote objects to the server where the actual remote
object implementation resides. A client's reference to a remote object,
therefore, is actually a reference to a local stub.
The stub implements only the remote interfaces, not any local interfaces
that the remote object also implements. Because the stub implements exactly
the same set of remote interfaces as the remote object itself, a client
can use the Java language's built-in operators for casting and type checking.
Compiler Utilisation
The syntax of the compilation command is : jrmic option_list | idl_File_List. The
command jrmic stands here for java org.omg.objectweb.david.tools.jrmic.JRMICompiler. It could
be implemented through a simple shell script (unix, Linux) or .bat file (dos, windows).
Following options are available in the present version :
- -classpath path
- Specifies the path jrmic uses to look up classes. This option overrides
the default or the CLASSPATH environment variable if it is set. Directories
are separated by semi-colons. Thus the general format for path is:
.;<your_path>
For example:
.;C:\usr\local\java\classes
- -d directory
- Specifies the root directory of the class hierarchy. You can use this option
to specify a destination directory for the stub and skeleton files. For
example, the command
% rmic -d C:\java\classes foo.MyClass
would place the stub and skeleton classes derived from MyClass into the
directory C:\java\classes\foo. If the -d option is not
used, the package hierarchy of the target class is ignored, and stub and
skeleton files are placed in the current directory.
- -depend
- Makes the compiler consider recompiling classes which are referenced from
other classes. Normally, it only recompiles missing or out-of-date classes
that are referred to from source code.
- -g
- Enables generation of debugging tables. Debugging tables contain information
about line numbers and local variables - information used by Java debugging
tools. By default, only line numbers are generated.
- -J
- Used in conjunction with the -D option, it passes the option following
it (no spaces between the -J and -D) on to the java interpreter.
- -keepgenerated
- Retains the generated .java source files for the stubs and skeletons
and writes them to the same directory as the .class files, using
the -d option if specified.
- -nowarn
- Turns off warnings. If used the compiler does not print out any warnings.
- -show
- Shows the GUI (graphical user interface) for the rmic compiler.
Enter one or more package qualified class names (separated by spaces) and
press either the Enter key or the Show button to create stubs and skeletons.
- -verbose
- Causes the compiler and linker to print out messages about what classes
are being compiled and what class files are being loaded.
Environment variables
- CLASSPATH
- Used to provide the system a path to user-defined classes. Directories
are separated by colons on UNIX and Macintosh and by semicolons on Win95.
For example,
.;C:\usr\local\java\classes