author | okutsu |
Thu, 08 Aug 2013 13:51:55 +0900 | |
changeset 19371 | bb9611d0308c |
parent 14342 | 8435a30053c1 |
child 21743 | 3d979da7bdf0 |
permissions | -rw-r--r-- |
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
12047
diff
changeset
|
1 |
." Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. |
12047 | 2 |
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 |
." |
|
4 |
." This code is free software; you can redistribute it and/or modify it |
|
5 |
." under the terms of the GNU General Public License version 2 only, as |
|
6 |
." published by the Free Software Foundation. |
|
7 |
." |
|
8 |
." This code is distributed in the hope that it will be useful, but WITHOUT |
|
9 |
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
10 |
." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
11 |
." version 2 for more details (a copy is included in the LICENSE file that |
|
12 |
." accompanied this code). |
|
13 |
." |
|
14 |
." You should have received a copy of the GNU General Public License version |
|
15 |
." 2 along with this work; if not, write to the Free Software Foundation, |
|
16 |
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
17 |
." |
|
18 |
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
19 |
." or visit www.oracle.com if you need additional information or have any |
|
20 |
." questions. |
|
21 |
." |
|
22 |
.TH idlj 1 "10 May 2011" |
|
23 |
||
24 |
.LP |
|
25 |
.SH "Name" |
|
26 |
idlj \- The IDL\-to\-Java Compiler |
|
27 |
.LP |
|
28 |
\f3idlj\fP generates Java bindings from a given IDL file. |
|
29 |
.SH "Synopsis" |
|
30 |
.LP |
|
31 |
.nf |
|
32 |
\f3 |
|
33 |
.fl |
|
34 |
idlj [ \fP\f3options\fP\f3 ] \fP\f4idl\-file\fP\f3 |
|
35 |
.fl |
|
36 |
\fP |
|
37 |
.fi |
|
38 |
||
39 |
.LP |
|
40 |
.LP |
|
41 |
where \f2idl\-file\fP is the name of a file containing Interface Definition Language (IDL) definitions. \f2Options\fP may appear in any order, but must precede the \f2idl\-file\fP. |
|
42 |
.LP |
|
43 |
.SH "Description" |
|
44 |
.LP |
|
45 |
.LP |
|
46 |
The IDL\-to\-Java Compiler generates the Java bindings for a given IDL file.\ For binding details, see the |
|
47 |
.na |
|
48 |
\f2OMG IDL to Java Language Language Mapping Specification\fP @ |
|
49 |
.fi |
|
50 |
http://download.oracle.com/javase/7/docs/technotes/guides/idl/mapping/jidlMapping.html. Some previous releases of the IDL\-to\-Java compiler were named \f2idltojava\fP. |
|
51 |
.LP |
|
52 |
.SS |
|
53 |
Emitting Client and Server Bindings |
|
54 |
.LP |
|
55 |
.LP |
|
56 |
To generate Java bindings for an IDL file named My.idl: |
|
57 |
.LP |
|
58 |
.nf |
|
59 |
\f3 |
|
60 |
.fl |
|
61 |
idlj My.idl |
|
62 |
.fl |
|
63 |
\fP |
|
64 |
.fi |
|
65 |
||
66 |
.LP |
|
67 |
.LP |
|
68 |
This generates the client\-side bindings and is equivalent to: |
|
69 |
.LP |
|
70 |
.nf |
|
71 |
\f3 |
|
72 |
.fl |
|
73 |
idlj \fP\f3\-fclient\fP My.idl |
|
74 |
.fl |
|
75 |
.fi |
|
76 |
||
77 |
.LP |
|
78 |
.LP |
|
79 |
The client\-side bindings do not include the server\-side skeleton. If you want to generate the server\-side bindings for the interfaces: |
|
80 |
.LP |
|
81 |
.nf |
|
82 |
\f3 |
|
83 |
.fl |
|
84 |
idlj \fP\f3\-fserver\fP My.idl |
|
85 |
.fl |
|
86 |
.fi |
|
87 |
||
88 |
.LP |
|
89 |
.LP |
|
90 |
Server\-side bindings include the client\-side bindings plus the skeleton, all of which are \f2POA\fP (that is, Inheritance Model) classes. If you want to generate both client and server\-side bindings, use one of the following (equivalent) commands: |
|
91 |
.LP |
|
92 |
.nf |
|
93 |
\f3 |
|
94 |
.fl |
|
95 |
idlj \fP\f3\-fclient \-fserver\fP My.idl |
|
96 |
.fl |
|
97 |
idlj \f3\-fall\fP My.idl |
|
98 |
.fl |
|
99 |
.fi |
|
100 |
||
101 |
.LP |
|
102 |
.LP |
|
103 |
There are two possible server\-side models: the Inheritance Model and the Tie Delegation Model. |
|
104 |
.LP |
|
105 |
.LP |
|
106 |
The default server\-side model is the \f2Portable Servant Inheritance Model\fP. Given an interface \f2My\fP defined in \f2My.idl\fP, the file \f2MyPOA.java\fP is generated. You must provide the implementation for \f2My\fP and it must inherit from \f2MyPOA\fP. |
|
107 |
.LP |
|
108 |
.LP |
|
109 |
\f2MyPOA.java\fP is a stream\-based skeleton that extends |
|
110 |
.na |
|
111 |
\f2org.omg.PortableServer.Servant\fP @ |
|
112 |
.fi |
|
113 |
http://download.oracle.com/javase/7/docs/api/org/omg/PortableServer/Servant.html and implements the \f2InvokeHandler\fP interface and the operations interface associated with the IDL interface the skeleton implements. |
|
114 |
.LP |
|
115 |
.LP |
|
116 |
The \f2PortableServer\fP module for the |
|
117 |
.na |
|
118 |
\f2Portable Object Adapter (POA)\fP @ |
|
119 |
.fi |
|
120 |
http://download.oracle.com/javase/7/docs/technotes/guides/idl/POA.html 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. |
|
121 |
.LP |
|
122 |
.LP |
|
123 |
Another option for the Inheritance Model is to use the \f2\-oldImplBase\fP flag in order to generate server\-side bindings that are compatible with versions of the Java programming language prior to J2SE 1.4. Note that using the \f2\-oldImplBase\fP flag is non\-standard: these APIs are being deprecated. You would use this flag ONLY for compatibility with existing servers written in J2SE 1.3. In that case, you would need to modify an existing MAKEFILE to add the \f2\-oldImplBase\fP flag to the \f2idlj\fP compiler, otherwise POA\-based server\-side mappings will be generated. To generate server\-side bindings that are backwards compatible: |
|
124 |
.LP |
|
125 |
.nf |
|
126 |
\f3 |
|
127 |
.fl |
|
128 |
idlj \fP\f3\-fclient \-fserver\fP \f3\-oldImplBase\fP My.idl |
|
129 |
.fl |
|
130 |
idlj \f3\-fall\fP \f3\-oldImplBase\fP My.idl |
|
131 |
.fl |
|
132 |
.fi |
|
133 |
||
134 |
.LP |
|
135 |
.LP |
|
136 |
Given an interface \f2My\fP defined in \f2My.idl\fP, the file \f2_MyImplBase.java\fP is generated. You must provide the implementation for \f2My\fP and it must inherit from \f2_MyImplBase\fP. |
|
137 |
.LP |
|
138 |
.LP |
|
139 |
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: |
|
140 |
.LP |
|
141 |
.nf |
|
142 |
\f3 |
|
143 |
.fl |
|
144 |
idlj \fP\f3\-fall\fP My.idl |
|
145 |
.fl |
|
146 |
idlj \f3\-fallTIE\fP My.idl |
|
147 |
.fl |
|
148 |
.fi |
|
149 |
||
150 |
.LP |
|
151 |
.LP |
|
152 |
For the interface \f2My\fP, the second command generates \f2MyPOATie.java\fP. The constructor to \f2MyPOATie\fP takes a \f2delegate\fP. In this example, using the default POA model, the constructor also needs a \f2poa\fP. You must provide the implementation for \f2delegate\fP, but it does not have to inherit from any other class, only the interface \f2MyOperations\fP. But to use it with the ORB, you must wrap your implementation within \f2MyPOATie\fP. For instance: |
|
153 |
.LP |
|
154 |
.nf |
|
155 |
\f3 |
|
156 |
.fl |
|
157 |
ORB orb = ORB.init(args, System.getProperties()); |
|
158 |
.fl |
|
159 |
||
160 |
.fl |
|
161 |
// Get reference to rootpoa & activate the POAManager |
|
162 |
.fl |
|
163 |
POA rootpoa = (POA)orb.resolve_initial_references("RootPOA"); |
|
164 |
.fl |
|
165 |
rootpoa.the_POAManager().activate(); |
|
166 |
.fl |
|
167 |
||
168 |
.fl |
|
169 |
// create servant and register it with the ORB |
|
170 |
.fl |
|
171 |
MyServant myDelegate = new MyServant(); |
|
172 |
.fl |
|
173 |
myDelegate.setORB(orb); |
|
174 |
.fl |
|
175 |
||
176 |
.fl |
|
177 |
// create a tie, with servant being the delegate. |
|
178 |
.fl |
|
179 |
MyPOATie tie = new MyPOATie(myDelegate, rootpoa); |
|
180 |
.fl |
|
181 |
||
182 |
.fl |
|
183 |
// obtain the objectRef for the tie |
|
184 |
.fl |
|
185 |
My ref = tie._this(orb); |
|
186 |
.fl |
|
187 |
\fP |
|
188 |
.fi |
|
189 |
||
190 |
.LP |
|
191 |
.LP |
|
192 |
You might want to use the Tie model instead of the typical Inheritance model if 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, that slot is used up . By using 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 invoking a method. |
|
193 |
.LP |
|
194 |
.LP |
|
195 |
To generate server\-side, Tie model bindings that are compatible with versions of the IDL to Java language mapping in versions prior to J2SE 1.4. |
|
196 |
.LP |
|
197 |
.nf |
|
198 |
\f3 |
|
199 |
.fl |
|
200 |
idlj \fP\f3\-oldImplBase\fP \f3\-fall\fP My.idl |
|
201 |
.fl |
|
202 |
idlj \f3\-oldImplBase\fP \f3\-fallTIE\fP My.idl |
|
203 |
.fl |
|
204 |
.fi |
|
205 |
||
206 |
.LP |
|
207 |
.LP |
|
208 |
For the interface \f2My\fP, this will generate \f2My_Tie.java\fP. The constructor to \f2My_Tie\fP takes a \f2impl\fP. You must provide the implementation for \f2impl\fP, but it does not have to inherit from any other class, only the interface \f2HelloOperations\fP. But to use it with the ORB, you must wrap your implementation within \f2My_Tie\fP. For instance: |
|
209 |
.LP |
|
210 |
.nf |
|
211 |
\f3 |
|
212 |
.fl |
|
213 |
ORB orb = ORB.init(args, System.getProperties()); |
|
214 |
.fl |
|
215 |
||
216 |
.fl |
|
217 |
// create servant and register it with the ORB |
|
218 |
.fl |
|
219 |
MyServant myDelegate = new MyServant(); |
|
220 |
.fl |
|
221 |
myDelegate.setORB(orb); |
|
222 |
.fl |
|
223 |
||
224 |
.fl |
|
225 |
// create a tie, with servant being the delegate. |
|
226 |
.fl |
|
227 |
MyPOATie tie = new MyPOATie(myDelegate); |
|
228 |
.fl |
|
229 |
||
230 |
.fl |
|
231 |
// obtain the objectRef for the tie |
|
232 |
.fl |
|
233 |
My ref = tie._this(orb); |
|
234 |
.fl |
|
235 |
\fP |
|
236 |
.fi |
|
237 |
||
238 |
.LP |
|
239 |
.SS |
|
240 |
Specifying Alternate Locations for Emitted Files |
|
241 |
.LP |
|
242 |
.LP |
|
243 |
If you want to direct the emitted files to a directory other than the current directory, invoke the compiler as: |
|
244 |
.LP |
|
245 |
.nf |
|
246 |
\f3 |
|
247 |
.fl |
|
248 |
idlj \fP\f3\-td /altdir\fP My.idl |
|
249 |
.fl |
|
250 |
.fi |
|
251 |
||
252 |
.LP |
|
253 |
.LP |
|
254 |
For the interface \f2My\fP, the bindings will be emitted to \f2/altdir/My.java\fP, etc., instead of \f2./My.java\fP. |
|
255 |
.LP |
|
256 |
.SS |
|
257 |
Specifying Alternate Locations for Include Files |
|
258 |
.LP |
|
259 |
.LP |
|
260 |
If \f2My.idl\fP included another idl file, \f2MyOther.idl\fP, the compiler assumes that \f2MyOther.idl\fP resides in the local directory. If it resides in \f2/includes\fP, for example, then you would invoke the compiler with the following command: |
|
261 |
.LP |
|
262 |
.nf |
|
263 |
\f3 |
|
264 |
.fl |
|
265 |
idlj \fP\f3\-i /includes\fP My.idl |
|
266 |
.fl |
|
267 |
.fi |
|
268 |
||
269 |
.LP |
|
270 |
.LP |
|
271 |
If \f2My.idl\fP also included \f2Another.idl\fP that resided in \f2/moreIncludes\fP, for example, then you would invoke the compiler with the following command: |
|
272 |
.LP |
|
273 |
.nf |
|
274 |
\f3 |
|
275 |
.fl |
|
276 |
idlj \fP\f3\-i /includes \-i /moreIncludes\fP My.idl |
|
277 |
.fl |
|
278 |
.fi |
|
279 |
||
280 |
.LP |
|
281 |
.LP |
|
282 |
Since this form of include can become irritatingly long, another means of indicating 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 \f2idl.config\fP in a directory that is listed in your CLASSPATH. Inside of \f2idl.config\fP, provide a line with the following form: |
|
283 |
.LP |
|
284 |
.nf |
|
285 |
\f3 |
|
286 |
.fl |
|
287 |
includes=/includes;/moreIncludes |
|
288 |
.fl |
|
289 |
\fP |
|
290 |
.fi |
|
291 |
||
292 |
.LP |
|
293 |
.LP |
|
294 |
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, etc. For more information on \f2includes\fP, see the |
|
295 |
.na |
|
296 |
\f2Setting the Classpath\fP @ |
|
297 |
.fi |
|
298 |
http://download.oracle.com/javase/7/docs/technotes/tools/index.html#general. |
|
299 |
.LP |
|
300 |
.SS |
|
301 |
Emitting Bindings for Include Files |
|
302 |
.LP |
|
303 |
.LP |
|
304 |
By default, only those interfaces, structs, etc, that are defined in the idl 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 idl files: |
|
305 |
.LP |
|
306 |
||
307 |
.LP |
|
308 |
.LP |
|
309 |
\f4My.idl\fP |
|
310 |
.LP |
|
311 |
.nf |
|
312 |
\f3 |
|
313 |
.fl |
|
314 |
#include <MyOther.idl> |
|
315 |
.fl |
|
316 |
interface My |
|
317 |
.fl |
|
318 |
{ |
|
319 |
.fl |
|
320 |
}; |
|
321 |
.fl |
|
322 |
\fP |
|
323 |
.fi |
|
324 |
||
325 |
.LP |
|
326 |
||
327 |
.LP |
|
328 |
.LP |
|
329 |
\f4MyOther.idl\fP |
|
330 |
.LP |
|
331 |
.nf |
|
332 |
\f3 |
|
333 |
.fl |
|
334 |
interface MyOther |
|
335 |
.fl |
|
336 |
{ |
|
337 |
.fl |
|
338 |
}; |
|
339 |
.fl |
|
340 |
\fP |
|
341 |
.fi |
|
342 |
||
343 |
.LP |
|
344 |
||
345 |
.LP |
|
346 |
.LP |
|
347 |
The following command will only generate the java bindings for \f2My\fP: |
|
348 |
.LP |
|
349 |
.nf |
|
350 |
\f3 |
|
351 |
.fl |
|
352 |
idlj My.idl |
|
353 |
.fl |
|
354 |
\fP |
|
355 |
.fi |
|
356 |
||
357 |
.LP |
|
358 |
.LP |
|
359 |
To generate all of the types in \f2My.idl\fP and all of the types in the files that \f2My.idl\fP includes (in this example, \f2MyOther.idl\fP), use the following command: |
|
360 |
.LP |
|
361 |
.nf |
|
362 |
\f3 |
|
363 |
.fl |
|
364 |
idlj \fP\f3\-emitAll\fP My.idl |
|
365 |
.fl |
|
366 |
.fi |
|
367 |
||
368 |
.LP |
|
369 |
.LP |
|
370 |
There is a caveat to the default rule. \f2#include\fP statements which appear at global scope are treated as described. These \f2#include\fP statements can be thought of as import statements. \f2#include\fP statements which appear within some enclosing scope are treated as true \f2#include\fP statements, meaning that the code within the included file is treated as if it appeared in the original file and, therefore, Java bindings are emitted for it. Here is an example: |
|
371 |
.LP |
|
372 |
||
373 |
.LP |
|
374 |
.LP |
|
375 |
\f4My.idl\fP |
|
376 |
.LP |
|
377 |
.nf |
|
378 |
\f3 |
|
379 |
.fl |
|
380 |
#include <MyOther.idl> |
|
381 |
.fl |
|
382 |
interface My |
|
383 |
.fl |
|
384 |
{ |
|
385 |
.fl |
|
386 |
#include <Embedded.idl> |
|
387 |
.fl |
|
388 |
}; |
|
389 |
.fl |
|
390 |
\fP |
|
391 |
.fi |
|
392 |
||
393 |
.LP |
|
394 |
||
395 |
.LP |
|
396 |
.LP |
|
397 |
\f4MyOther.idl\fP |
|
398 |
.LP |
|
399 |
.nf |
|
400 |
\f3 |
|
401 |
.fl |
|
402 |
interface MyOther |
|
403 |
.fl |
|
404 |
{ |
|
405 |
.fl |
|
406 |
}; |
|
407 |
.fl |
|
408 |
\fP |
|
409 |
.fi |
|
410 |
||
411 |
.LP |
|
412 |
||
413 |
.LP |
|
414 |
.LP |
|
415 |
\f4Embedded.idl\fP |
|
416 |
.LP |
|
417 |
.nf |
|
418 |
\f3 |
|
419 |
.fl |
|
420 |
enum E {one, two, three}; |
|
421 |
.fl |
|
422 |
\fP |
|
423 |
.fi |
|
424 |
||
425 |
.LP |
|
426 |
||
427 |
.LP |
|
428 |
.LP |
|
429 |
Running the following command: |
|
430 |
.LP |
|
431 |
.nf |
|
432 |
\f3 |
|
433 |
.fl |
|
434 |
idlj My.idl |
|
435 |
.fl |
|
436 |
\fP |
|
437 |
.fi |
|
438 |
||
439 |
.LP |
|
440 |
.LP |
|
441 |
will generate the following list of Java files: |
|
442 |
.LP |
|
443 |
.nf |
|
444 |
\f3 |
|
445 |
.fl |
|
446 |
./MyHolder.java |
|
447 |
.fl |
|
448 |
./MyHelper.java |
|
449 |
.fl |
|
450 |
./_MyStub.java |
|
451 |
.fl |
|
452 |
./MyPackage |
|
453 |
.fl |
|
454 |
./MyPackage/EHolder.java |
|
455 |
.fl |
|
456 |
./MyPackage/EHelper.java |
|
457 |
.fl |
|
458 |
./MyPackage/E.java |
|
459 |
.fl |
|
460 |
./My.java |
|
461 |
.fl |
|
462 |
\fP |
|
463 |
.fi |
|
464 |
||
465 |
.LP |
|
466 |
.LP |
|
467 |
Notice that \f2MyOther.java\fP was not generated because it is defined in an import\-like \f2#include\fP. But \f2E.java\fP \f2was\fP generated because it was defined in a true \f2#include\fP. Also notice that since \f2Embedded.idl\fP was included within the scope of the interface \f2My\fP, it appears within the scope of \f2My\fP (that is,in \f2MyPackage\fP). |
|
468 |
.LP |
|
469 |
.LP |
|
470 |
If the \f2\-emitAll\fP flag had been used in the previous example, then all types in all included files would be emitted. |
|
471 |
.LP |
|
472 |
.SS |
|
473 |
Inserting Package Prefixes |
|
474 |
.LP |
|
475 |
.LP |
|
476 |
Suppose that you work for a company named ABC that has constructed the following IDL file: |
|
477 |
.LP |
|
478 |
||
479 |
.LP |
|
480 |
.LP |
|
481 |
\f4Widgets.idl\fP |
|
482 |
.LP |
|
483 |
.nf |
|
484 |
\f3 |
|
485 |
.fl |
|
486 |
module Widgets |
|
487 |
.fl |
|
488 |
{ |
|
489 |
.fl |
|
490 |
interface W1 {...}; |
|
491 |
.fl |
|
492 |
interface W2 {...}; |
|
493 |
.fl |
|
494 |
}; |
|
495 |
.fl |
|
496 |
\fP |
|
497 |
.fi |
|
498 |
||
499 |
.LP |
|
500 |
||
501 |
.LP |
|
502 |
.LP |
|
503 |
Running this file through the IDL\-to\-Java compiler will place the Java bindings for \f2W1\fP and \f2W2\fP within the package \f2Widgets\fP. But there is an industry convention that states that a company's packages should reside within a package named \f2com.<company name>\fP. The \f2Widgets\fP package is not good enough. To follow convention, it should be \f2com.abc.Widgets\fP. To place this package prefix onto the \f2Widgets\fP module, execute the following: |
|
504 |
.LP |
|
505 |
.nf |
|
506 |
\f3 |
|
507 |
.fl |
|
508 |
idlj \fP\f3\-pkgPrefix Widgets com.abc\fP Widgets.idl |
|
509 |
.fl |
|
510 |
.fi |
|
511 |
||
512 |
.LP |
|
513 |
.LP |
|
514 |
If you have an IDL file which includes \f2Widgets.idl\fP, the \f2\-pkgPrefix\fP flag must appear in that command also. If it does not, then your IDL file will be looking for a \f2Widgets\fP package rather than a \f2com.abc.Widgets\fP package. |
|
515 |
.LP |
|
516 |
.LP |
|
517 |
If you have a number of these packages that require prefixes, it might be easier to place them into the \f2idl.config\fP file described above. Each package prefix line should be of the form: |
|
518 |
.LP |
|
519 |
.nf |
|
520 |
\f3 |
|
521 |
.fl |
|
522 |
PkgPrefix.<type>=<prefix> |
|
523 |
.fl |
|
524 |
\fP |
|
525 |
.fi |
|
526 |
||
527 |
.LP |
|
528 |
So the line for the above example would be: |
|
529 |
.nf |
|
530 |
\f3 |
|
531 |
.fl |
|
532 |
PkgPrefix.Widgets=com.abc |
|
533 |
.fl |
|
534 |
\fP |
|
535 |
.fi |
|
536 |
||
537 |
.LP |
|
538 |
.LP |
|
539 |
The use of this option does not affect the Repository ID. |
|
540 |
.LP |
|
541 |
.SS |
|
542 |
Defining Symbols Before Compilation |
|
543 |
.LP |
|
544 |
.LP |
|
545 |
You may 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 |
|
546 |
.LP |
|
547 |
.nf |
|
548 |
\f3 |
|
549 |
.fl |
|
550 |
idlj \fP\f3\-d\fP MYDEF My.idl |
|
551 |
.fl |
|
552 |
.fi |
|
553 |
||
554 |
.LP |
|
555 |
.LP |
|
556 |
is the equivalent of putting the line \f2#define MYDEF\fP inside \f2My.idl\fP. |
|
557 |
.LP |
|
558 |
.SS |
|
559 |
Preserving Pre\-Existing Bindings |
|
560 |
.LP |
|
561 |
.LP |
|
562 |
If the Java binding files already exist, the \f2\-keep\fP flag will keep the compiler from overwriting them. The default is to generate all files without considering if they already exist. If you've customized those files (which you should not do unless you are very comfortable with their contents), then the \f2\-keep\fP option is very useful. The command |
|
563 |
.LP |
|
564 |
.nf |
|
565 |
\f3 |
|
566 |
.fl |
|
567 |
idlj \fP\f3\-keep\fP My.idl |
|
568 |
.fl |
|
569 |
.fi |
|
570 |
||
571 |
.LP |
|
572 |
.LP |
|
573 |
emits all client\-side bindings that do not already exist. |
|
574 |
.LP |
|
575 |
.SS |
|
576 |
Viewing Progress of Compilation |
|
577 |
.LP |
|
578 |
.LP |
|
579 |
The IDL\-to\-Java compiler will generate status messages as it progresses through its phases of execution. Use the \f2\-v\fP option to activate this "verbose" mode: |
|
580 |
.LP |
|
581 |
.nf |
|
582 |
\f3 |
|
583 |
.fl |
|
584 |
idlj \fP\f3\-v\fP My.idl |
|
585 |
.fl |
|
586 |
.fi |
|
587 |
||
588 |
.LP |
|
589 |
.LP |
|
590 |
By default the compiler does not operate in verbose mode. |
|
591 |
.LP |
|
592 |
.SS |
|
593 |
Displaying Version Information |
|
594 |
.LP |
|
595 |
.LP |
|
596 |
To display the build version of the IDL\-to\-Java compiler, specify the \f2\-version\fP option on the command\-line: |
|
597 |
.LP |
|
598 |
.nf |
|
599 |
\f3 |
|
600 |
.fl |
|
601 |
idlj \-version |
|
602 |
.fl |
|
603 |
\fP |
|
604 |
.fi |
|
605 |
||
606 |
.LP |
|
607 |
.LP |
|
608 |
Version information also appears within the bindings generated by the compiler. Any additional options appearing on the command\-line are ignored. |
|
609 |
.LP |
|
610 |
.SH "Options" |
|
611 |
.LP |
|
612 |
.RS 3 |
|
613 |
.TP 3 |
|
614 |
\-d symbol |
|
615 |
This is equivalent to the following line in an IDL file: |
|
616 |
.nf |
|
617 |
\f3 |
|
618 |
.fl |
|
619 |
#define \fP\f4symbol\fP\f3 |
|
620 |
.fl |
|
621 |
\fP |
|
622 |
.fi |
|
623 |
.TP 3 |
|
624 |
\-emitAll |
|
625 |
Emit all types, including those found in \f2#include\fP files. |
|
626 |
.TP 3 |
|
627 |
\-fside |
|
628 |
Defines what bindings to emit. \f2side\fP is one of \f2client\fP, \f2server\fP, \f2serverTIE\fP, \f2all\fP, or \f2allTIE\fP. The \f2\-fserverTIE\fP and \f2\-fallTIE\fP options cause delegate model skeletons to be emitted. Assumes \f2\-fclient\fP if the flag is not specified. |
|
629 |
.TP 3 |
|
630 |
\-i include\-path |
|
631 |
By default, the current directory is scanned for included files. This option adds another directory. |
|
632 |
.TP 3 |
|
633 |
\-keep |
|
634 |
If a file to be generated already exists, do not overwrite it. By default it is overwritten. |
|
635 |
.TP 3 |
|
636 |
\-noWarn |
|
637 |
Suppresses warning messages. |
|
638 |
.TP 3 |
|
639 |
\-oldImplBase |
|
640 |
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 older versions of the Java programming language by generating server\-side bindings that are \f2ImplBase\fP Inheritance Model classes. |
|
641 |
.TP 3 |
|
642 |
\-pkgPrefix type prefix |
|
643 |
Wherever \f2type\fP is encountered at file scope, prefix the generated Java package name with \f2prefix\fP for all files generated for that type. The \f2type\fP is the simple name of either a top\-level module, or an IDL type defined outside of any module. |
|
644 |
.TP 3 |
|
645 |
\-pkgTranslate type package |
|
646 |
Whenever the module name \f2type\fP is encountered in an identifier, replace it in the identifier with \f2package\fP for all files in the generated Java package. Note that \f2pkgPrefix\fP changes are made first. \f2type\fP 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. |
|
647 |
.br |
|
648 |
.br |
|
649 |
If more than one translation matches an identifier, the longest match is chosen. For example, if the arguments include: |
|
650 |
.nf |
|
651 |
\f3 |
|
652 |
.fl |
|
653 |
\-pkgTranslate foo bar \-pkgTranslate foo.baz buzz.fizz |
|
654 |
.fl |
|
655 |
\fP |
|
656 |
.fi |
|
657 |
The following translations would occur: |
|
658 |
.nf |
|
659 |
\f3 |
|
660 |
.fl |
|
661 |
foo => bar |
|
662 |
.fl |
|
663 |
foo.boo => bar.boo |
|
664 |
.fl |
|
665 |
foo.baz => buzz.fizz |
|
666 |
.fl |
|
667 |
foo.baz.bar => buzz.fizz.bar |
|
668 |
.fl |
|
669 |
\fP |
|
670 |
.fi |
|
671 |
The following package names cannot be translated: |
|
672 |
.RS 3 |
|
673 |
.TP 2 |
|
674 |
o |
|
675 |
\f2org\fP |
|
676 |
.TP 2 |
|
677 |
o |
|
678 |
\f2org.omg\fP or any subpackages of \f2org.omg\fP |
|
679 |
.RE |
|
680 |
Any attempt to translate these packages will result in uncompilable code, and the use of these packages as the first argument after \f2\-pkgTranslate\fP will be treated as an error. |
|
681 |
.TP 3 |
|
682 |
\-skeletonName xxx%yyy |
|
683 |
Use \f2xxx%yyy\fP as the pattern for naming the skeleton. The defaults are: |
|
684 |
.RS 3 |
|
685 |
.TP 2 |
|
686 |
o |
|
687 |
%POA for the \f2POA\fP base class (\f2\-fserver\fP or \f2\-fall\fP) |
|
688 |
.TP 2 |
|
689 |
o |
|
690 |
_%ImplBase for the \f2oldImplBase\fP class (\f2\-oldImplBase\fP and (\f2\-fserver\fP or \f2\-fall\fP)) |
|
691 |
.RE |
|
692 |
.TP 3 |
|
693 |
\-td dir |
|
694 |
Use \f2dir\fP for the output directory instead of the current directory. |
|
695 |
.TP 3 |
|
696 |
\-tieName xxx%yyy |
|
697 |
Name the tie according to the pattern. The defaults are: |
|
698 |
.RS 3 |
|
699 |
.TP 2 |
|
700 |
o |
|
701 |
%POATie for the \f2POA\fP tie base class (\f2\-fserverTie\fP or \f2\-fallTie\fP) |
|
702 |
.TP 2 |
|
703 |
o |
|
704 |
%_Tie for the \f2oldImplBase\fP tie class (\f2\-oldImplBase\fP and (\f2\-fserverTie\fP or \f2\-fallTie\fP)) |
|
705 |
.RE |
|
706 |
.TP 3 |
|
707 |
\-nowarn, \-verbose |
|
708 |
Verbose mode. |
|
709 |
.TP 3 |
|
710 |
\-version |
|
711 |
Display version information and terminate. |
|
712 |
.RE |
|
713 |
||
714 |
.LP |
|
715 |
.LP |
|
716 |
See the Description section for more option information. |
|
717 |
.LP |
|
718 |
.SH "Restrictions:" |
|
719 |
.LP |
|
720 |
.RS 3 |
|
721 |
.TP 2 |
|
722 |
o |
|
723 |
Escaped identifiers in the global scope may not have the same spelling as IDL primitive types, \f2Object\fP, or \f2ValueBase\fP. This is because the symbol table is pre\-loaded with these identifiers; allowing them to be redefined would overwrite their original definitions. (Possible permanent restriction). |
|
724 |
.TP 2 |
|
725 |
o |
|
726 |
The \f2fixed\fP IDL type is not supported. |
|
727 |
.RE |
|
728 |
||
729 |
.LP |
|
730 |
.SH "Known Problems:" |
|
731 |
.LP |
|
732 |
.RS 3 |
|
733 |
.TP 2 |
|
734 |
o |
|
735 |
No import generated for global identifiers. If you invoke on an unexported local impl, you do get an exception, but it seems to be due to a \f2NullPointerException\fP in the \f2ServerDelegate\fP DSI code. |
|
736 |
.RE |
|
737 |
||
738 |
.LP |
|
739 |