author | rehn |
Fri, 07 Jul 2017 23:04:06 +0200 | |
changeset 46643 | cb5f289ba033 |
parent 31876 | 91b22707521a |
permissions | -rw-r--r-- |
21743 | 1 |
'\" t |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
2 |
.\" Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
3 |
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
4 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
5 |
.\" This code is free software; you can redistribute it and/or modify it |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
6 |
.\" under the terms of the GNU General Public License version 2 only, as |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
7 |
.\" published by the Free Software Foundation. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
8 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
9 |
.\" This code is distributed in the hope that it will be useful, but WITHOUT |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
10 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
11 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
12 |
.\" version 2 for more details (a copy is included in the LICENSE file that |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
13 |
.\" accompanied this code). |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
14 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
15 |
.\" You should have received a copy of the GNU General Public License version |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
16 |
.\" 2 along with this work; if not, write to the Free Software Foundation, |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
17 |
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
18 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
19 |
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
20 |
.\" or visit www.oracle.com if you need additional information or have any |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
21 |
.\" questions. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
22 |
.\" |
21743 | 23 |
.\" Arch: generic |
24 |
.\" Software: JDK 8 |
|
25 |
.\" Date: 21 November 2013 |
|
26 |
.\" SectDesc: Java IDL and RMI-IIOP Tools |
|
27 |
.\" Title: idlj.1 |
|
28 |
.\" |
|
29 |
.if n .pl 99999 |
|
30 |
.TH idlj 1 "21 November 2013" "JDK 8" "Java IDL and RMI-IIOP Tools" |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
31 |
.\" ----------------------------------------------------------------- |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
32 |
.\" * Define some portability stuff |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
33 |
.\" ----------------------------------------------------------------- |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
34 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
35 |
.\" http://bugs.debian.org/507673 |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
36 |
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
37 |
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
38 |
.ie \n(.g .ds Aq \(aq |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
39 |
.el .ds Aq ' |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
40 |
.\" ----------------------------------------------------------------- |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
41 |
.\" * set default formatting |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
42 |
.\" ----------------------------------------------------------------- |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
43 |
.\" disable hyphenation |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
44 |
.nh |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
45 |
.\" disable justification (adjust text to left margin only) |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
46 |
.ad l |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
47 |
.\" ----------------------------------------------------------------- |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
48 |
.\" * MAIN CONTENT STARTS HERE * |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
49 |
.\" ----------------------------------------------------------------- |
12047 | 50 |
|
21743 | 51 |
.SH NAME |
52 |
idlj \- Generates Java bindings for a specified Interface Definition Language (IDL) file\&. |
|
53 |
.SH SYNOPSIS |
|
54 |
.sp |
|
55 |
.nf |
|
12047 | 56 |
|
21743 | 57 |
\fBidlj\fR [ \fIoptions\fR ] \fIidlfile\fR |
58 |
.fi |
|
59 |
.sp |
|
60 |
.TP |
|
61 |
\fIoptions\fR |
|
62 |
The command-line options\&. See Options\&. Options can appear in any order, but must precede the \f3idlfile\fR\&. |
|
63 |
.TP |
|
64 |
\fIidlfile\fR |
|
65 |
The name of a file that contains Interface Definition Language (IDL) definitions\&. |
|
66 |
.SH DESCRIPTION |
|
67 |
The IDL-to-Java Compiler generates the Java bindings for a specified IDL file\&. For binding details, see Java IDL: IDL to Java Language Mapping at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/mapping/jidlMapping\&.html |
|
68 |
.PP |
|
69 |
Some earlier releases of the IDL-to-Java compiler were named \f3idltojava\fR\&. |
|
70 |
.SS EMIT\ CLIENT\ AND\ SERVER\ BINDINGS |
|
71 |
The following \f3idlj\fR command generates an IDL file named \f3My\&.idl\fR with client-side bindings\&. |
|
72 |
.sp |
|
73 |
.nf |
|
74 |
\f3idlj My\&.idl\fP |
|
75 |
.fi |
|
76 |
.nf |
|
77 |
\f3\fR |
|
78 |
.fi |
|
79 |
.sp |
|
80 |
The previous syntax is equivalent to the following: |
|
81 |
.sp |
|
82 |
.nf |
|
83 |
\f3idlj \-fclient My\&.idl\fP |
|
84 |
.fi |
|
85 |
.nf |
|
86 |
\f3\fR |
|
87 |
.fi |
|
88 |
.sp |
|
89 |
The next example generates the server-side bindings, and includes the client-side bindings plus the skeleton, all of which are POA (Inheritance Model)\&. |
|
90 |
.sp |
|
91 |
.nf |
|
92 |
\f3idlg \-fserver My\&.idl\fP |
|
93 |
.fi |
|
94 |
.nf |
|
95 |
\f3\fR |
|
96 |
.fi |
|
97 |
.sp |
|
98 |
If you want to generate both client and server-side bindings, then use one of the following (equivalent) commands: |
|
99 |
.sp |
|
100 |
.nf |
|
101 |
\f3idlj \-fclient \-fserver My\&.idl\fP |
|
102 |
.fi |
|
103 |
.nf |
|
104 |
\f3idlj \-fall My\&.idl\fP |
|
105 |
.fi |
|
106 |
.nf |
|
107 |
\f3\fR |
|
108 |
.fi |
|
109 |
.sp |
|
110 |
There are two possible server-side models: the Portal Servant Inheritance Model and the Tie Model\&. See Tie Delegation Model\&. |
|
111 |
.PP |
|
112 |
\f3Portable Servant Inheritance Model\fR\&. The default server-side model is the Portable Servant Inheritance Model\&. Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3MyPOA\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3MyPOA\fR class\&. \f3MyPOA\&.java\fR is a stream-based skeleton that extends the \f3org\&.omg\&.PortableServer\&.Servant\fR class at http://docs\&.oracle\&.com/javase/8/docs/api/org/omg/PortableServer/Servant\&.html The \f3My\fR interface implements the \f3callHandler\fR interface and the operations interface associated with the IDL interface the skeleton implements\&.The \f3PortableServer\fR module for the Portable Object Adapter (POA) defines the native \f3Servant\fR type\&. See Portable Object Adapter (POA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/idl/POA\&.html In the Java programming language, the \f3Servant\fR type is mapped to the Java \f3org\&.omg\&.PortableServer\&.Servant\fR class\&. It serves as the base class for all POA servant implementations and provides a number of methods that can be called by the application programmer, and methods that are called by the POA and that can be overridden by the user to control aspects of servant behavior\&.Another option for the Inheritance Model is to use the \f3-oldImplBase\fR flag to generate server-side bindings that are compatible with releases of the Java programming language before Java SE 1\&.4\&. The -\f3oldImplBase\fR flag is nonstandard, and these APIs are deprecated\&. You would use this flag only for compatibility with existing servers written in Java SE 1\&.3\&. In that case, you would need to modify an existing make file to add the \f3-oldImplBase\fR flag to the \f3idlj\fR compiler\&. Otherwise POA-based server-side mappings are generated\&. To generate server-side bindings that are backward compatible, do the following: |
|
113 |
.sp |
|
114 |
.nf |
|
115 |
\f3idlj \-fclient \-fserver \-oldImplBase My\&.idl\fP |
|
116 |
.fi |
|
117 |
.nf |
|
118 |
\f3idlj \-fall \-oldImplBase My\&.idl\fP |
|
119 |
.fi |
|
120 |
.nf |
|
121 |
\f3\fR |
|
122 |
.fi |
|
123 |
.sp |
|
124 |
Given an interface \f3My\fR defined in \f3My\&.idl\fR, the file \f3_MyImplBase\&.java\fR is generated\&. You must provide the implementation for the \f3My\fR interface, and the \f3My\fR interface must inherit from the \f3_MyImplBase\fR class\&. |
|
125 |
.PP |
|
126 |
\f3Tie Delegation Model\fR\&. The other server-side model is called the Tie Model\&. This is a delegation model\&. Because it is not possible to generate ties and skeletons at the same time, they must be generated separately\&. The following commands generate the bindings for the Tie Model: |
|
127 |
.sp |
|
128 |
.nf |
|
129 |
\f3idlj \-fall My\&.idl\fP |
|
130 |
.fi |
|
131 |
.nf |
|
132 |
\f3idlj \-fallTIE My\&.idl\fP |
|
133 |
.fi |
|
134 |
.nf |
|
135 |
\f3\fR |
|
136 |
.fi |
|
137 |
.sp |
|
138 |
For the \f3My\fR interface, the second command generates \f3MyPOATie\&.java\fR\&. The constructor to the \f3MyPOATie\fR class takes a delegate\&. In this example, using the default POA model, the constructor also needs a POA\&. You must provide the implementation for the delegate, but it does not have to inherit from any other class, only the interface \f3MyOperations\fR\&. To use it with the ORB, you must wrap your implementation within the \f3MyPOATie\fR class, for example: |
|
139 |
.sp |
|
140 |
.nf |
|
141 |
\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP |
|
142 |
.fi |
|
143 |
.nf |
|
144 |
\f3\fR |
|
145 |
.fi |
|
146 |
.nf |
|
147 |
\f3// Get reference to rootpoa & activate the POAManager\fP |
|
148 |
.fi |
|
149 |
.nf |
|
150 |
\f3POA rootpoa = (POA)orb\&.resolve_initial_references("RootPOA");\fP |
|
151 |
.fi |
|
152 |
.nf |
|
153 |
\f3rootpoa\&.the_POAManager()\&.activate();\fP |
|
154 |
.fi |
|
155 |
.nf |
|
156 |
\f3\fR |
|
157 |
.fi |
|
158 |
.nf |
|
159 |
\f3// create servant and register it with the ORB\fP |
|
160 |
.fi |
|
161 |
.nf |
|
162 |
\f3MyServant myDelegate = new MyServant();\fP |
|
163 |
.fi |
|
164 |
.nf |
|
165 |
\f3myDelegate\&.setORB(orb); \fP |
|
166 |
.fi |
|
167 |
.nf |
|
168 |
\f3\fR |
|
169 |
.fi |
|
170 |
.nf |
|
171 |
\f3// create a tie, with servant being the delegate\&.\fP |
|
172 |
.fi |
|
173 |
.nf |
|
174 |
\f3MyPOATie tie = new MyPOATie(myDelegate, rootpoa);\fP |
|
175 |
.fi |
|
176 |
.nf |
|
177 |
\f3\fR |
|
178 |
.fi |
|
179 |
.nf |
|
180 |
\f3// obtain the objectRef for the tie\fP |
|
181 |
.fi |
|
182 |
.nf |
|
183 |
\f3My ref = tie\&._this(orb);\fP |
|
184 |
.fi |
|
185 |
.nf |
|
186 |
\f3\fR |
|
187 |
.fi |
|
188 |
.sp |
|
189 |
You might want to use the Tie model instead of the typical Inheritance model when your implementation must inherit from some other implementation\&. Java allows any number of interface inheritance, but there is only one slot for class inheritance\&. If you use the inheritance model, then that slot is used up\&. With the Tie Model, that slot is freed up for your own use\&. The drawback is that it introduces a level of indirection: one extra method call occurs when a method is called\&. |
|
190 |
.PP |
|
191 |
For server-side generation, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions earlier than Java SE 1\&.4\&. |
|
192 |
.sp |
|
193 |
.nf |
|
194 |
\f3idlj \-oldImplBase \-fall My\&.idl\fP |
|
195 |
.fi |
|
196 |
.nf |
|
197 |
\f3idlj \-oldImplBase \-fallTIE My\&.idl\fP |
|
198 |
.fi |
|
199 |
.nf |
|
200 |
\f3\fR |
|
201 |
.fi |
|
202 |
.sp |
|
203 |
For the \f3My\fR interface, the this generates \f3My_Tie\&.java\fR\&. The constructor to the \f3My_Tie\fR class takes an \f3impl\fR object\&. You must provide the implementation for \f3impl\fR, but it does not have to inherit from any other class, only the interface \f3HelloOperations\fR\&. But to use it with the ORB, you must wrap your implementation within \f3My_Tie\fR, for example: |
|
204 |
.sp |
|
205 |
.nf |
|
206 |
\f3ORB orb = ORB\&.init(args, System\&.getProperties());\fP |
|
207 |
.fi |
|
208 |
.nf |
|
209 |
\f3\fR |
|
210 |
.fi |
|
211 |
.nf |
|
212 |
\f3// create servant and register it with the ORB\fP |
|
213 |
.fi |
|
214 |
.nf |
|
215 |
\f3MyServant myDelegate = new MyServant();\fP |
|
216 |
.fi |
|
217 |
.nf |
|
218 |
\f3myDelegate\&.setORB(orb); \fP |
|
219 |
.fi |
|
220 |
.nf |
|
221 |
\f3\fR |
|
222 |
.fi |
|
223 |
.nf |
|
224 |
\f3// create a tie, with servant being the delegate\&.\fP |
|
225 |
.fi |
|
226 |
.nf |
|
227 |
\f3MyPOATie tie = new MyPOATie(myDelegate);\fP |
|
228 |
.fi |
|
229 |
.nf |
|
230 |
\f3\fR |
|
231 |
.fi |
|
232 |
.nf |
|
233 |
\f3// obtain the objectRef for the tie\fP |
|
234 |
.fi |
|
235 |
.nf |
|
236 |
\f3My ref = tie\&._this(orb);\fP |
|
237 |
.fi |
|
238 |
.nf |
|
239 |
\f3\fR |
|
240 |
.fi |
|
241 |
.sp |
|
242 |
.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ EMITTED\ FILES |
|
243 |
If you want to direct the emitted files to a directory other than the current directory, then call the compiler this way: \f3i\fR\f3dlj -td /altdir My\&.idl\fR\&. |
|
244 |
.PP |
|
245 |
For the \f3My\fR interface, the bindings are emitted to \f3/altdir/My\&.java\fR, etc\&., instead of \f3\&./My\&.java\fR\&. |
|
246 |
.SS SPECIFY\ ALTERNATE\ LOCATIONS\ FOR\ INCLUDE\ FILES |
|
247 |
If the \f3My\&.idl\fR file includes another \f3idl\fR file, \f3MyOther\&.idl\fR, then the compiler assumes that the \f3MyOther\&.idl\fR file resides in the local directory\&. If it resides in \f3/includes\fR, for example, then you call the compiler with the following command: |
|
248 |
.sp |
|
249 |
.nf |
|
250 |
\f3idlj \-i /includes My\&.idl\fP |
|
251 |
.fi |
|
252 |
.nf |
|
253 |
\f3\fR |
|
254 |
.fi |
|
255 |
.sp |
|
256 |
If \f3My\&.idl\fR also included \f3Another\&.idl\fR that resided in \f3/moreIncludes\fR, for example, then you call the compiler with the following command: |
|
257 |
.sp |
|
258 |
.nf |
|
259 |
\f3idlj \-i /includes \-i /moreIncludes My\&.idl\fP |
|
260 |
.fi |
|
261 |
.nf |
|
262 |
\f3\fR |
|
263 |
.fi |
|
264 |
.sp |
|
265 |
Because this form of \f3include\fR can become long, another way to indicate to the compiler where to search for included files is provided\&. This technique is similar to the idea of an environment variable\&. Create a file named idl\&.config in a directory that is listed in your \f3CLASSPATH\fR variable\&. Inside of \f3idl\&.config\fR, provide a line with the following form: |
|
266 |
.sp |
|
267 |
.nf |
|
268 |
\f3includes=/includes;/moreIncludes\fP |
|
269 |
.fi |
|
270 |
.nf |
|
271 |
\f3\fR |
|
272 |
.fi |
|
273 |
.sp |
|
274 |
The compiler will find this file and read in the includes list\&. Note that in this example the separator character between the two directories is a semicolon (;)\&. This separator character is platform dependent\&. On the Windows platform, use a semicolon, on the Unix platform, use a colon, and so on\&. |
|
275 |
.SS EMIT\ BINDINGS\ FOR\ INCLUDE\ FILES |
|
276 |
By default, only those interfaces, structures, and so on, that are defined in the \f3idl\fR file on the command line have Java bindings generated for them\&. The types defined in included files are not generated\&. For example, assume the following two \f3idl\fR files: |
|
277 |
.sp |
|
278 |
.nf |
|
279 |
\f3My\&.idl file:\fP |
|
280 |
.fi |
|
281 |
.nf |
|
282 |
\f3\fR |
|
283 |
.fi |
|
284 |
.nf |
|
285 |
\f3#include <MyOther\&.idl>\fP |
|
286 |
.fi |
|
287 |
.nf |
|
288 |
\f3interface My\fP |
|
289 |
.fi |
|
290 |
.nf |
|
291 |
\f3{\fP |
|
292 |
.fi |
|
293 |
.nf |
|
294 |
\f3};\fP |
|
295 |
.fi |
|
296 |
.nf |
|
297 |
\f3\fR |
|
298 |
.fi |
|
299 |
.nf |
|
300 |
\f3MyOther\&.idl file:\fP |
|
301 |
.fi |
|
302 |
.nf |
|
303 |
\f3\fR |
|
304 |
.fi |
|
305 |
.nf |
|
306 |
\f3interface MyOther\fP |
|
307 |
.fi |
|
308 |
.nf |
|
309 |
\f3{\fP |
|
310 |
.fi |
|
311 |
.nf |
|
312 |
\f3};\fP |
|
313 |
.fi |
|
314 |
.nf |
|
315 |
\f3\fR |
|
316 |
.fi |
|
317 |
.sp |
|
318 |
There is a caveat to the default rule\&. Any \f3#include\fR statements that appear at the global scope are treated as described\&. These \f3#include\fR statements can be thought of as import statements\&. The \f3#include\fR statements that appear within an enclosed scope are treated as true \f3#include\fR statements, which means that the code within the included file is treated as though it appeared in the original file and, therefore, Java bindings are emitted for it\&. Here is an example: |
|
319 |
.sp |
|
320 |
.nf |
|
321 |
\f3My\&.idl file:\fP |
|
322 |
.fi |
|
323 |
.nf |
|
324 |
\f3\fR |
|
325 |
.fi |
|
326 |
.nf |
|
327 |
\f3#include <MyOther\&.idl>\fP |
|
328 |
.fi |
|
329 |
.nf |
|
330 |
\f3interface My\fP |
|
331 |
.fi |
|
332 |
.nf |
|
333 |
\f3{\fP |
|
334 |
.fi |
|
335 |
.nf |
|
336 |
\f3 #include <Embedded\&.idl>\fP |
|
337 |
.fi |
|
338 |
.nf |
|
339 |
\f3};\fP |
|
340 |
.fi |
|
341 |
.nf |
|
342 |
\f3\fR |
|
343 |
.fi |
|
344 |
.nf |
|
345 |
\f3MyOther\&.idl file:\fP |
|
346 |
.fi |
|
347 |
.nf |
|
348 |
\f3\fR |
|
349 |
.fi |
|
350 |
.nf |
|
351 |
\f3interface MyOther\fP |
|
352 |
.fi |
|
353 |
.nf |
|
354 |
\f3{\fP |
|
355 |
.fi |
|
356 |
.nf |
|
357 |
\f3};\fP |
|
358 |
.fi |
|
359 |
.nf |
|
360 |
\f3\fR |
|
361 |
.fi |
|
362 |
.nf |
|
363 |
\f3Embedded\&.idl\fP |
|
364 |
.fi |
|
365 |
.nf |
|
366 |
\f3\fR |
|
367 |
.fi |
|
368 |
.nf |
|
369 |
\f3enum E {one, two, three};\fP |
|
370 |
.fi |
|
371 |
.nf |
|
372 |
\f3\fR |
|
373 |
.fi |
|
374 |
.sp |
|
375 |
Run\f3idlj My\&.idl\fRto generate the following list of Java files\&. Notice that \f3MyOther\&.java\fR is not generated because it is defined in an import-like \f3#include\fR\&. But \f3E\&.java\fR was generated because it was defined in a true \f3#include\fR\&. Notice that because the \f3Embedded\&.idl\fR file is included within the scope of the interface \f3My\fR, it appears within the scope of \f3My\fR (in \f3MyPackage\fR)\&. If the \f3-emitAll\fR flag had been used, then all types in all included files would have been emitted\&. |
|
376 |
.sp |
|
377 |
.nf |
|
378 |
\f3\&./MyHolder\&.java\fP |
|
379 |
.fi |
|
380 |
.nf |
|
381 |
\f3\&./MyHelper\&.java\fP |
|
382 |
.fi |
|
383 |
.nf |
|
384 |
\f3\&./_MyStub\&.java\fP |
|
385 |
.fi |
|
386 |
.nf |
|
387 |
\f3\&./MyPackage\fP |
|
388 |
.fi |
|
389 |
.nf |
|
390 |
\f3\&./MyPackage/EHolder\&.java\fP |
|
391 |
.fi |
|
392 |
.nf |
|
393 |
\f3\&./MyPackage/EHelper\&.java\fP |
|
394 |
.fi |
|
395 |
.nf |
|
396 |
\f3\&./MyPackage/E\&.java\fP |
|
397 |
.fi |
|
398 |
.nf |
|
399 |
\f3\&./My\&.java\fP |
|
400 |
.fi |
|
401 |
.nf |
|
402 |
\f3\fR |
|
403 |
.fi |
|
404 |
.sp |
|
405 |
.SS INSERT\ PACKAGE\ PREFIXES |
|
12047 | 406 |
Suppose that you work for a company named ABC that has constructed the following IDL file: |
21743 | 407 |
.sp |
408 |
.nf |
|
409 |
\f3Widgets\&.idl file:\fP |
|
410 |
.fi |
|
411 |
.nf |
|
412 |
\f3\fR |
|
413 |
.fi |
|
414 |
.nf |
|
415 |
\f3module Widgets\fP |
|
416 |
.fi |
|
417 |
.nf |
|
418 |
\f3{\fP |
|
419 |
.fi |
|
420 |
.nf |
|
421 |
\f3 interface W1 {\&.\&.\&.};\fP |
|
422 |
.fi |
|
423 |
.nf |
|
424 |
\f3 interface W2 {\&.\&.\&.};\fP |
|
425 |
.fi |
|
426 |
.nf |
|
427 |
\f3};\fP |
|
428 |
.fi |
|
429 |
.nf |
|
430 |
\f3\fR |
|
431 |
.fi |
|
432 |
.sp |
|
433 |
If you run this file through the IDL-to-Java compiler, then the Java bindings for W1 and W2 are placed within the \f3Widgets\fR package\&. There is an industry convention that states that a company\&'s packages should reside within a package named \f3com\&.<company name>\fR\&. To follow this convention, the package name should be \f3com\&.abc\&.Widgets\fR\&. To place this package prefix onto the Widgets module, execute the following: |
|
434 |
.sp |
|
435 |
.nf |
|
436 |
\f3idlj \-pkgPrefix Widgets com\&.abc Widgets\&.idl\fP |
|
437 |
.fi |
|
438 |
.nf |
|
439 |
\f3\fR |
|
440 |
.fi |
|
441 |
.sp |
|
442 |
If you have an IDL file that includes Widgets\&.idl, then the \f3-pkgPrefix\fR flag must appear in that command also\&. If it does not, then your IDL file will be looking for a \f3Widgets\fR package rather than a \f3com\&.abc\&.Widgets\fR package\&. |
|
443 |
.PP |
|
444 |
If you have a number of these packages that require prefixes, then it might be easier to place them into the idl\&.config file described previously\&. Each package prefix line should be of the form: \f3PkgPrefix\&.<type>=<prefix>\fR\&. The line for the previous example would be \f3PkgPrefix\&.Widgets=com\&.abc\fR\&. This option does not affect the Repository ID\&. |
|
445 |
.SS DEFINE\ SYMBOLS\ BEFORE\ COMPILATION |
|
446 |
You might need to define a symbol for compilation that is not defined within the IDL file, perhaps to include debugging code in the bindings\&. The command \f3idlj -d MYDEF My\&.idl\fRis equivalent to putting the line \f3#define MYDEF\fR inside My\&.idl\&. |
|
447 |
.SS PRESERVE\ PREEXISTING\ BINDINGS |
|
448 |
If the Java binding files already exist, then the \f3-keep\fR flag keeps the compiler from overwriting them\&. The default is to generate all files without considering that they already exist\&. If you have customized those files (which you should not do unless you are very comfortable with their contents), then the \f3-keep\fR option is very useful\&. The command \f3idlj -keep My\&.idl\fR emits all client-side bindings that do not already exist\&. |
|
449 |
.SS VIEW\ COMPILATION\ PROGRESS |
|
450 |
The IDL-to-Java compiler generates status messages as it progresses through its phases of execution\&. Use the \f3-v\fR option to activate the verbose mode: \f3idlj -v My\&.idl\fR\&. |
|
451 |
.PP |
|
452 |
By default the compiler does not operate in verbose mode |
|
453 |
.SS DISPLAY\ VERSION\ INFORMATION |
|
454 |
To display the build version of the IDL-to-Java compiler, specify the \f3-version\fR option on the command-line: \f3idlj -version\fR\&. |
|
455 |
.PP |
|
456 |
Version information also appears within the bindings generated by the compiler\&. Any additional options appearing on the command-line are ignored\&. |
|
457 |
.SH OPTIONS |
|
458 |
.TP |
|
459 |
-d \fIsymbol\fR |
|
460 |
.br |
|
461 |
This is equivalent to the following line in an IDL file: |
|
462 |
.sp |
|
463 |
.nf |
|
464 |
\f3#define \fIsymbol\fR\fP |
|
465 |
.fi |
|
466 |
.nf |
|
467 |
\f3\fR |
|
468 |
.fi |
|
469 |
.sp |
|
12047 | 470 |
|
21743 | 471 |
.TP |
472 |
-demitAll |
|
473 |
.br |
|
474 |
Emit all types, including those found in \f3#include\fR files\&. |
|
475 |
.TP |
|
476 |
-fside |
|
477 |
.br |
|
478 |
Defines what bindings to emit\&. The \f3side\fR parameter can be \f3client\fR, \f3server\fR, \f3serverTIE\fR, \f3all\fR, or \f3allTIE\fR\&. The \f3-fserverTIE\fR and \f3-fallTIE\fR options cause delegate model skeletons to be emitted\&. Defaults to \f3-fclient\fR when the flag is not specified\&. |
|
479 |
.TP |
|
480 |
-i \fIinclude-path\fR |
|
481 |
.br |
|
482 |
By default, the current directory is scanned for included files\&. This option adds another directory\&. |
|
483 |
.TP |
|
484 |
-i \fIkeep\fR |
|
485 |
.br |
|
486 |
If a file to be generated already exists, then do not overwrite it\&. By default it is overwritten\&. |
|
487 |
.TP |
|
488 |
-noWarn |
|
489 |
.br |
|
490 |
Suppress warning messages\&. |
|
491 |
.TP |
|
492 |
-oldImplBase |
|
493 |
.br |
|
494 |
Generates skeletons compatible with pre-1\&.4 JDK ORBs\&. By default, the POA Inheritance Model server-side bindings are generated\&. This option provides backward-compatibility with earlier releases of the Java programming language by generating server-side bindings that are \f3ImplBase\fR Inheritance Model classes\&. |
|
495 |
.TP |
|
496 |
-pkgPrefix \fItype\fR\fIprefix\fR |
|
497 |
.br |
|
498 |
Wherever \f3type\fR is encountered at file scope, prefix the generated Java package name with \f3prefix\fR for all files generated for that type\&. The type is the simple name of either a top-level module, or an IDL type defined outside of any module\&. |
|
499 |
.TP |
|
500 |
-pkgTranslate \fItype\fR\fIpackage\fR |
|
501 |
.br |
|
502 |
Whenever the module name type is encountered in an identifier, replace it in the identifier with package for all files in the generated Java package\&. Note that \f3pkgPrefix\fR changes are made first\&. The type value is the simple name of either a top-level module, or an IDL type defined outside of any module and must match the full package name exactly\&. |
|
12047 | 503 |
|
21743 | 504 |
If more than one translation matches an identifier, then the longest match is chosen as shown in the following example: |
12047 | 505 |
|
21743 | 506 |
\fICommand\fR: |
507 |
.sp |
|
508 |
.nf |
|
509 |
\f3pkgTranslate type pkg \-pkgTranslate type2\&.baz pkg2\&.fizz\fP |
|
510 |
.fi |
|
511 |
.nf |
|
512 |
\f3\fR |
|
513 |
.fi |
|
514 |
.sp |
|
515 |
||
12047 | 516 |
|
21743 | 517 |
\fIResulting Translation\fR: |
518 |
.sp |
|
519 |
.nf |
|
520 |
\f3type => pkg\fP |
|
521 |
.fi |
|
522 |
.nf |
|
523 |
\f3type\&.ext => pkg\&.ext\fP |
|
524 |
.fi |
|
525 |
.nf |
|
526 |
\f3type\&.baz => pkg2\&.fizz\fP |
|
527 |
.fi |
|
528 |
.nf |
|
529 |
\f3type2\&.baz\&.pkg => pkg2\&.fizz\&.pkg\fP |
|
530 |
.fi |
|
531 |
.nf |
|
532 |
\f3\fR |
|
533 |
.fi |
|
534 |
.sp |
|
535 |
||
536 |
||
537 |
The following package names \f3org\fR, \f3org\fR\&.o\f3mg\fR, or any subpackages of \f3org\&.omg\fR cannot be translated\&. Any attempt to translate these packages results in uncompilable code, and the use of these packages as the first argument after \f3-pkgTranslate\fR is treated as an error\&. |
|
538 |
.TP |
|
539 |
-skeletonName \fIxxx%yyy\fR |
|
12047 | 540 |
.br |
21743 | 541 |
Use \f3xxx%yyy\fR as the pattern for naming the skeleton\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserver\fR or \f3-fall\fR), and \f3_%ImplBase\fR for the \f3oldImplBase\fR class (-\f3oldImplBase\fR) and (\f3-fserver\fR or \f3-fall\fR))\&. |
542 |
.TP |
|
543 |
-td \fIdir\fR |
|
544 |
.br |
|
545 |
Use \fIdir\fR for the output directory instead of the current directory\&. |
|
546 |
.TP |
|
547 |
-tieName \fIxxx%yyy\fR |
|
548 |
.br |
|
549 |
Use \f3xxx%yyy\fR according to the pattern\&. The defaults are: \f3%POA\fR for the \f3POA\fR base class (\f3-fserverTie or -fallTie\fR), and \f3_%Tie\fR for the \f3oldImplBase\fR tie class (-\f3oldImplBase\fR) and (\f3-fserverTie\fR or \f3-fallTie\fR)) |
|
550 |
.TP |
|
551 |
-nowarn, -verbose |
|
552 |
.br |
|
553 |
Displays release information and terminates\&. |
|
554 |
.TP |
|
555 |
-version |
|
556 |
.br |
|
557 |
Displays release information and terminates\&. |
|
558 |
.SH RESTRICTIONS |
|
559 |
Escaped identifiers in the global scope cannot have the same spelling as IDL primitive types, \f3Object\fR, or \f3ValueBase\fR\&. This is because the symbol table is preloaded with these identifiers\&. Allowing them to be redefined would overwrite their original definitions\&. Possible permanent restriction\&. |
|
560 |
.PP |
|
561 |
The \f3fixed\fR IDL type is not supported\&. |
|
562 |
.SH KNOWN\ PROBLEMS |
|
563 |
No import is generated for global identifiers\&. If you call an unexported local \f3impl\fR object, then you do get an exception, but it seems to be due to a \f3NullPointerException\fR in the \f3ServerDelegate\fR DSI code\&. |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
564 |
.RE |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
565 |
.br |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
566 |
'pl 8.5i |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
567 |
'bp |