blob: eaa6247c363b8f8e9cf50b58fcc1973b027a0a5f [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001.'" t
2."
3." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
4." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5."
6." This code is free software; you can redistribute it and/or modify it
7." under the terms of the GNU General Public License version 2 only, as
8." published by the Free Software Foundation.
9."
10." This code is distributed in the hope that it will be useful, but WITHOUT
11." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13." version 2 for more details (a copy is included in the LICENSE file that
14." accompanied this code).
15."
16." You should have received a copy of the GNU General Public License version
17." 2 along with this work; if not, write to the Free Software Foundation,
18." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19."
20." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21." CA 95054 USA or visit www.sun.com if you need additional information or
22." have any questions.
23."
24." `
25.TH rmic 1 "05 Aug 2006"
26." Generated by html2roff
27
28.LP
29.SH NAME
30rmic \- The Java RMI Compiler
31.LP
32
33.LP
34.LP
35\f3rmic\fP generates stub, skeleton, and tie classes for remote objects using either the JRMP or IIOP protocols. Also generates OMG IDL.
36.LP
37.SH "SYNOPSIS"
38.LP
39
40.LP
41.nf
42\f3
43.fl
44rmic [ \fP\f3options\fP\f3 ] \fP\f4package\-qualified\-class\-name(s)\fP\f3
45.fl
46\fP
47.fi
48
49.LP
50.SH "DESCRIPTION"
51.LP
52
53.LP
54.LP
55The \f3rmic\fP 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 compiled Java programming language classes that are remote object implementation classes. A remote implementation class is a class that implements the interface \f2java.rmi.Remote\fP. The class names in the \f3rmic\fP command must be for classes that have been compiled successfully with the \f3javac\fP command and must be fully package qualified. For example, running \f3rmic\fP on the class file name \f2HelloImpl\fP as shown here:
56.LP
57.nf
58\f3
59.fl
60rmic hello.HelloImpl
61.fl
62\fP
63.fi
64
65.LP
66.LP
67creates the \f2HelloImpl_Stub.class\fP file in the \f2hello\fP subdirectory (named for the class's package).
68.LP
69.LP
70A \f2skeleton\fP for a remote object is a JRMP protocol server\-side entity that has a method that dispatches calls to the actual remote object implementation.
71.LP
72.LP
73A \f2tie\fP for a remote object is a server\-side entity similar to a skeleton, but which communicates with the client using the IIOP protocol.
74.LP
75.LP
76A \f2stub\fP is a client\-side proxy for a remote object which is responsible for communicating 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.
77.LP
78.LP
79By default, \f3rmic\fP generates stub classes that use the 1.2 JRMP stub protocol version only, as if the \f2\-v1.2\fP option had been specified. (Note that the \f2\-vcompat\fP option was the default in releases prior to 5.0.) Use the \f2\-iiop\fP option to generate stub and tie classes for the IIOP protocol.
80.LP
81.LP
82A stub implements only the remote interfaces, not any local interfaces that the remote object also implements. Because a JRMP stub implements the same set of remote interfaces as the remote object itself, a client can use the Java programming language's built\-in operators for casting and type checking. For IIOP, the \f2PortableRemoteObject.narrow\fP method must be used.
83.LP
84.SH "OPTIONS"
85.LP
86
87.LP
88.TP 3
89\-bootclasspath path
90Overrides location of bootstrap class files
91.TP 3
92\-classpath path
93Specifies the path \f3rmic\fP uses to look up classes. This option overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by colons. Thus the general format for \f2path\fP is:
94.RS 3
95
96.LP
97.nf
98\f3
99.fl
100.:<your_path>
101.fl
102\fP
103.fi
104.RE
105For example:
106.RS 3
107
108.LP
109.nf
110\f3
111.fl
112.:/usr/local/java/classes
113.fl
114\fP
115.fi
116.RE
117.TP 3
118\-d directory
119Specifies the root destination directory for the generated class hierarchy. You can use this option to specify a destination directory for the stub, skeleton, and tie files. For example, the command
120.RS 3
121
122.LP
123.nf
124\f3
125.fl
126% rmic \-d /java/classes foo.MyClass
127.fl
128\fP
129.fi
130.RE
131would place the stub and skeleton classes derived from \f2MyClass\fP into the directory \f2/java/classes/foo\fP. If the \f2\-d\fP option is not specified, the default behavior is as if \f2"\-d\ ."\fP 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 some previous versions of \f3rmic\fP, if \f2\-d\fP was not specified, then the package hierarchy was \f2not\fP created, and all of the output files were placed directly in the current directory.)
132.br
133\
134.TP 3
135\-extdirs path
136Overrides location of installed extensions
137.TP 3
138\-g
139Enables generation of all debugging information, including local variables. By default, only line number information is generated.
140.TP 3
141\-idl
142Causes \f2rmic\fP 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
143.na
144\f2Java Language to IDL Mapping\fP @
145.fi
146http://www.omg.org/technology/documents/formal/java_language_mapping_to_omg_idl.htm (OMG) document for a complete description.
147.LP
148When the \f2\-idl\fP option is used, other options also include:
149.TP 3
150\-always or \-alwaysgenerate
151Forces re\-generation even when existing stubs/ties/IDL are newer than the input class.
152.TP 3
153\-factory
154Uses factory keyword in generated IDL.
155.TP 3
156\-idlModule\ fromJavaPackage[.class]\
157toIDLModule
158Specifies IDLEntity package mapping. For example:\ \f2\-idlModule foo.bar my::real::idlmod\fP.
159.TP 3
160\-idlFile\ fromJavaPackage[.class]\
161toIDLFile
162Specifies IDLEntity file mapping. For example:\ \f2\-idlFile test.pkg.X TEST16.idl\fP.\
163.LP
164.TP 3
165\-iiop
166Causes \f2rmic\fP 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 is 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.
167.LP
168Invoking \f2rmic\fP with the \f2\-iiop\fP generates stubs and ties that conform to this naming convention:
169.RS 3
170
171.LP
172.nf
173\f3
174.fl
175_<implementationName>_stub.class
176.fl
177\fP
178.br
179\f3
180.fl
181_<interfaceName>_tie.class
182.fl
183\fP
184.fi
185.RE
186.LP
187When the \f2\-iiop\fP option is used, other options also include:
188.TP 3
189\-always or \-alwaysgenerate
190Forces re\-generation even when existing stubs/ties/IDL are newer than the input class.
191.TP 3
192\-nolocalstubs
193Do not create stubs optimized for same\-process clients and servers.
194.TP 3
195\-noValueMethods
196Must be used with the \f2\-idl\fP option. Prevents addition of \f2valuetype\fP methods and initializers to emitted IDL. These methods and initializers are optional for \f2valuetype\fPs, and are generated unless the \f2\-noValueMethods\fP option is specified when using the \f2\-idl\fP option.
197.TP 3
198\-poa
199Changes the inheritance from \f2org.omg.CORBA_2_3.portable.ObjectImpl\fP to \f2org.omg.PortableServer.Servant\fP.
200.LP
201The \f2PortableServer\fP module for the
202.na
203\f2Portable Object Adapter\fP @
204.fi
205http://java.sun.com/javase/6/docs/technotes/guides/idl/POA.html (POA) defines the native \f2Servant\fP type. In the Java programming language, the \f2Servant\fP type is mapped to the Java \f2org.omg.PortableServer.Servant\fP class. It serves as the base class for all POA servant implementations and provides a number of methods that may be invoked by the application programmer, as well as methods which are invoked by the POA itself and may be overridden by the user to control aspects of servant behavior. Based on the OMG IDL to Java Language Mapping Specification, CORBA V 2.3.1 ptc/00\-01\-08.pdf.
206.TP 3
207\-J
208Used in conjunction with any \f2java\fP option, it passes the option following the \f2\-J\fP (no spaces between the \-J and the option) on to the \f2java\fP interpreter.
209.TP 3
210\-keep or \-keepgenerated
211Retains the generated \f2.java\fP source files for the stub, skeleton, and/or tie classes and writes them to the same directory as the \f2.class\fP files.
212.TP 3
213\-nowarn
214Turns off warnings. If used the compiler does not print out any warnings.
215.TP 3
216\-vcompat
217Generates stub and skeleton classes compatible with both the 1.1 and 1.2 JRMP stub protocol versions. (This option was the default in releases prior to 5.0.) The generated stub classes will use the 1.1 stub protocol version when loaded in a JDK 1.1 virtual machine and will use the 1.2 stub protocol version when loaded into a 1.2 (or later) virtual machine. The generated skeleton classes will support both 1.1 and 1.2 stub protocol versions. The generated classes are relatively large in order to support both modes of operation.
218.TP 3
219\-verbose
220Causes the compiler and linker to print out messages about what classes are being compiled and what class files are being loaded.
221.TP 3
222\-v1.1
223Generates stub and skeleton classes for the 1.1 JRMP stub protocol version only. Note that this option is only useful for generating stub classes that are serialization\-compatible with pre\-existing, statically\-deployed stub classes that were generated by the \f3rmic\fP tool from JDK 1.1 and that cannot be upgraded (and dynamic class loading is not being used).
224.TP 3
225\-v1.2
226(default) Generates stub classes for the 1.2 JRMP stub protocol version only. No skeleton classes are generated with this option because skeleton classes are not used with the 1.2 stub protocol version. The generated stub classes will not work if they are loaded into a JDK 1.1 virtual machine.
227.LP
228.SH "ENVIRONMENT VARIABLES"
229.LP
230
231.LP
232.TP 3
233CLASSPATH
234Used to provide the system a path to user\-defined classes. Directories are separated by colons. For example,
235.RS 3
236
237.LP
238.nf
239\f3
240.fl
241.:/usr/local/java/classes
242.fl
243\fP
244.fi
245.RE
246
247.LP
248.SH "SEE ALSO"
249.LP
250
251.LP
252.LP
253java, javac, CLASSPATH
254.LP
255
256.LP
257