idl2java - The IDL to Java Compiler

idl2java compiles OMG CORBA IDL into portable Java language bindings.

SYNOPSIS

idl2java [options] IDL-file(s)

where options include:
    -help           print out this message
    -J<vm flag>     pass argument to the java interpreter
    -ds <directory> destination directory for generated source
    -pkgprefix <t> <prefix> package prefix for type or module <t>
    -genincluded    generate #included files
    -poa            generate stubs and skels to be used with POA
    -multicast      generate stub/skels for Multicast Invocations
    -dynamic        generate stubs and skeletons that use DII/DSI
    -nostub         do not generate the stubs
    -noskel         do not generate the skeletons
    -notie          do not generate the TIE based skeletons
    -nolocal        do not enable stubs for local invocation
    -smartstubs     generate smart stubs
    -compile        compile the generated Java source files
    -nokeep         delete the generated Java source files
    -verbose        turn verbose mode on
pre-processor options:
    -I <directory>  directory to look for included IDL files
    -D <symbol>     predefine symbol
java-compiler options:
    -classpath <directories separated by colons>
                    list directories in which to look for classes
    -d <directory>  destination directory for classes
    -g              enable generation of debugging information
    -O              generate optimized code
    -depend         make compiler consider compiling dependencies
    -nowarn         turns off warning by the Java compiler

DESCRIPTION

idl2java is a CORBA 2.2 compliant IDL to Java compiler. The IDL source is contained in files with .idl extension. idl2java generates Java language bindings for the IDL contained in these files. It supports multiple stub/skel architectures (POA and non-POA), inheritance as well as delegation based skeletons, and local as well as remote stubs. The compiler includes a subset of the ANSI C pre-processor and can optionally directly call the Java compiler to compile the generated Java code.

OPTIONS

-help
Print the command line syntax and a short description of the compiler options.
-JruntimeFlag
Used to pass runtime flags to the Java interpreter/runtime. For example, in conjunction with the -D option, it sets a Java System property. Muliple -J arguments can be used to specify more than one runtime flags.
-ds directory
Specifies the root directory of the generated Java source. The current directory is the default value for directory.
-pkgprefix  type_or_module_name prefix
Specifies the package prefix for a Java type or an IDL module at file scope. For example, the COS Naming idl is compiled using "-pkgPrefix CosNaming org.omg" parameters to the idl2java compiler.
-genincluded
By default, idl2java compiler does not generate code for the IDL definitions that are part of the #included files. If this flag is specified, the code is generated for all definitions.
-poa
Specifies that the generated skeletons should work with the Portable Object Adapter (POA). POA skeletons extend org.omg.PortableServer.Servant class.

If -poa is not specified, then the generated skeletons can only be used to write simple transient objects. These skeletons extend org.omg.CORBA.portable.ObjectImpl. The adapter APIs to use are ORB.connect and ORB.disconnect.

-multicast
Specifies that the compiler should generate stubs and skeletons for Multicast Object Invocations. The -poa and -multicast options are mutually exclusive.
-dynamic
Specifies that the generated stubs and skeletons should use ORB Dynamic invocation interfaces DII and DSI for marshalling parameters. If this flag is not specified, the stubs and skeletons do direct marshaling/unmarshaling to/from the IIOP streams respectively.
-nostub
Specifies that the stub should not be generated. This is useful when the client for the IDL interface is not a Java program.
-noskel
Specifies that the skeleton should not be generated. This is useful when the server for the IDL interface is not written in Java.
-notie
Specifies that delegation based skeletons should not be generated.
-nolocal
Specifies that local stubs (that do direct invocations to servant in the same Java VM) should not be generated. Local stubs provide a fast local IPC mechanism. This option is only meaningful when used with -poa because  for non-POA case, servants are already object references.
-smartstubs
Specifies that code should be generated such that the application developers can provide their own implementation of the Stubs. The smart stub is required to extend the default stub. With this option, two additional methods are generated in the Helper classes generated for the IDL interfaces - setStubClass, and getStubClass.
-compile
Specifies that the generated Java code should be compiled. See Java compiler options.
-verbose
Put the idl2java compile in verbose mode. It prints out the IDL files it is reading and the Java files it is generating.

Pre-processing Options

idl2java implements a subset of the ANSI C pre-processor functionality. The subset includes processing of #ifdef, #ifndef, #else, #endif, simple #define, #undef, #line, #pragma, and #include. It does not support token pasting and macro expansion.
-I directory
Specifies the directory which is searched for #included files. Note that there is a space after the -I. Multiple -I options can be specified to give the compiler multiple directories to search in sequence for #included files.
-D symbol
Specifies that the symbol be defined during pre-processing of the IDL files. The symbol JAVA is predefined by the idl2java compiler. It can be used to conditionally compile idl files containing Java only pragmas.

JAVA Compiler Options

-classpath path
Specifies the path javac uses to look up classes needed to run javac or being referenced by other classes you are compiling. Overrides the default or the CLASSPATH environment variable if it is set. Directories are separated by colons. It is often useful for the directory containing the source files to be on the class path. You should always include the system classes at the end of the path.
-d directory
Specifies the root directory of the class file hierarchy. In other words, this is essentially a destination directory for your compiled classes. The current directory is the default value for directory.
-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, unless optimization (-O) is turned on.
-O
Directs the compiler to try to generate faster code by inlining static, final and private methods. This option may slow down compilation, make larger class files, and/or make it difficult to debug.
-nowarn
Turns off warnings. If used the Java compiler does not print out any warnings.

EXAMPLES

SEE ALSO

rmi2iiop
 

Copyright © 1998-2003, Novell, Inc. All rights reserved.