rmic - The Java RMI Stub Compiler (RMI-IIOP version)

rmic generates stubs, skeletons, ties for remote objects using either the JRMP or IIOP protocols. Also generates OMG IDL.

SYNOPSIS

rmic [ options ] package-qualified-class-name(s)

DESCRIPTION

The rmic compiler generates stub, and skeleton class files (JRMP protocol), and stub and tie class files (IIOP protocol) for remote objects. These classes files are generated from the compiled Java classes that contain remote object implementations. A remote object is an object that implements the interface java.rmi.Remote). The classes named in the rmic command must be fully package qualified. For example, running rmic on the class file name HelloImpl as shown here:
rmic 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. Skeletons communicate with clients using the JRMP protocol.

A tie for a remote object is a server-side entity similar to a skeleton, but which communicates with the client using the IIOP protocol.

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 is, therefore, a reference to a local stub.

The stub implements only the remote interfaces, not any local interfaces that the remote object also implements. Because a JRMP 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. For IIOP, the PortableRemoteObject.narrow method must be used.

OPTIONS

-always or -alwaysgenerate
Forces re-generation even when existing stubs/ties/IDL are newer than the input class.  Only valid when -iiop and/or -idl flags are present.

-classpath path
Specifies the path rmic uses to look up classes. This option overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by semicolons (Windows) or colons (Solaris). The following examples show the general format for path.

Windows:

.;<your_path>
For example:
.;C:\usr\local\java\classes

Solaris:

.:<your_path>
For example:
.:/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, tie, and skeleton files. For example, the command

Windows:

% rmic -d C:\java\classes foo.MyClass

Solaris:

% rmic -d /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 specified, the default behavior is as if "-d ." were specified: the package hierarchy of the target class is created in the current directory, and stub/tie/skeleton files are placed within it. Note that in previous versions of rmic, the package hierarchy was *not* created, and the output files were placed directly 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.
-idl
Causes rmic to generate OMG IDL for the classes specified and any classes referenced. IDL provides a purely declarative, programming language-independent way of specifying an object's API. The IDL is used as a specification for methods and data that can be written in and invoked from any language that provides CORBA bindings. This includes Java and C++ among others. See the Java Language to IDL Mapping (OMG) document for a complete description.

See also the -idlFile, -idlModule, and -noValueMethods options.

-idlModule  fromJavaPackage[.class]  toIDLModule
Specifies IDLEntity package mapping.  For example:  -idlModule foo.bar my::real::idlmod.  Only valid when -idl flag is present.

-idlFile  fromJavaPackage[.class]  toIDLFile
Specifies IDLEntity file mapping.  For example:  -idlFile test.pkg.X TEST16.idl.  Only valid when -idl flag is present.

-iiop
Causes rmic to generate IIOP stub and tie classes, rather than JRMP stub and skeleton classes. A stub class is a local proxy for a remote object, and are used by clients to send calls to a server. Each remote interface requires a stub class, which implements that remote interface. A client's reference to a remote object is actually a reference to a stub. Tie classes are used on the server side to process incoming calls, and dispatch the calls to the proper implementation class. Each implementation class requires a tie class.

Invoking rmic with the -iiop generates stubs and ties that conform to this naming convention:

_<implementationName>_stub.class

_<interfaceName>_tie.class

-J
Used in conjunction with the -D option, causes rmic to pass the option following the -D (no spaces between the -J and -D) on to the java interpreter.

-keepgenerated or -keep
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.

-nolocalstubs
Do not create stubs optimized for same-process clients and servers. Must be used with the -iiop option.

-noValueMethods
Must be used with the -idl option. Prevents addition of valuetype methods and initializers to emitted IDL. These methods and initializers are optional for valuetypes, and are generated unless the -noValueMethods option is specified when using the -idl option.

-nowarn
Turns off warnings. If used the compiler does not print out any warnings.

-vcompat
(default) Creates stubs and skeletons compatible with both JDK 1.1 and 1.2 stub protocol versions.

-verbose
Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded.

-v1.1
Create stubs and skeletons for JDK 1.1 stub protocol version.

-v1.2
Create stubs for JDK 1.2 stub protocol version only.