idlj: The Java IDL Compiler


idlj: The Java IDL CompilerSince JDK 1.3

Synopsis

     idlj [ options ] IDLfile

Description

The idlj compiler generates Java source files from interfaces, modules, and type descriptions defined in IDL. The compiler implements the standard IDL-to-Java mapping defined by the OMG.

The idlj compiler accepts the standard IDL preprocessor directives, such as #include, which includes declarations from another IDL file, and #define, which defines symbols to be used for conditional compilation with #ifdef directives.

Run with no arguments at all, idlj generates all the client-side Java classes mapped from the specified IDL file. To generate both client and server-side Java bindings, you need to use the -fall option described later.

As of JDK 1.4, idlj generates POA-compliant server-side classes. The server skeletons inherit from org.omg.PortableServer.Servant and use the POA operations to implement the skeleton. In JDK 1.3, idlj generates server classes based on the nonstandard ImplBase inheritance scheme. The ImplBase scheme can also be used in JDK 1.4, by using the -oldImplBase option described later.

Options


-d symbol

Defines the named symbol during preprocessing of the IDL file. Invoking idlj:

     % idlj -d foobar Account.idl

is equivalent to placing the following preprocessing directive at the top of the Account.idl file:

      #define foobar


-emitAll

By default, idlj emits Java mappings only for entities found directly in the specified IDL file. This options causes idlj to emit Java mappings for all entities found in this file and in any files #include'd in the file.


-f< side>

Controls whether to generate client- and/or server-side mappings and which flavor of mappings to generate. The following values are supported:


client

Default value. Emits only the client-side mappings for the IDL entities.


server

Emits only the server-side mappings. In JDK 1.3, it generates ImplBase-style skeletons by default; as of JDK 1.4, it generates POA-compliant skeletons by default.


serverTIE

Emits server-side mappings based on the TIE delegation model. See Chapter 14 for more details on the TIE model.


all

Generates both client and server mappings. This is equivalent to specifying -fclient -fserver on the command line.


allTIE

Generates both client and server mappings, but the server mappings follow the TIE delegation model. This is equivalent to specifying -fclient -fserverTIE on the command line.


-i < path>

The given path should be used to search for files specified in #include directives found in the IDL file. You can include multiple paths using multiple -i options on the command line, or you can use a delimited list of paths with a single -i option. The paths are delimited by colons on Unix variants (Linux, Mac OS, Solaris, etc.), and by semicolons on Windows.


-J< javaoption>

Passes the specified option directly to the underlying Java virtual machine. There is no space between the -J and the option. For example, use the following to run the JVM in verbose mode:

     > idlj -J-verbose ...


-keep

Don't overwrite a generated file if it already exists. By default, the compiler overwrites existing Java files. This is handy if you've customized generated Java files and want to only regenerate other files emitted from the IDL.


-noWarn

Don't print warning messages if encountered when compiling the IDL.


-oldImplBase

This version of idlj generates POA-compliant server classes by default. This option instructs the compiler to generate the ImplBase-style server skeletons used in older versions of Java IDL (1.3 and 1.2).


-pkgPrefix < entity> < prefix>

Overrides the normal package prefix given to the named entity. Normally entities such as an IDL module, interface, value type, and so on are placed into a package based on the modules it falls within. This option lets you override this procedure for a given entity using a specific package name.


-pkgTranslate < moduleName> < newName>

Wherever the string specified by <moduleName> is found in an IDL identifier, it's replaced with the <newName> in the generated Java files. For example, if you have an IDL file containing a module Servers with an interface PrintServer, this invocation of idlj:

     > idlj -pkgTranslate Servers com.myorg.Servers servers.idl

causes the PrintServer interface to map to the package com.myorg.Servers. You can use multiple -pkgTranslate options on the command line.


-skeletonName < prefix>%< postfix>

It allows you to customize the name of generated server skeletons, where % represents the name of the IDL interface being mapped. If you have an IDL file containing an interface PrintServer, the following:

     > idlj -skeletonName foo%bar servers.idl

generates a server skeleton class named fooPrintServerbar, in a file of the same name. By default, skeletons are named <interfaceName>POA if POA-compliant server classes are generated; they are named _<interfaceName>ImplBase if ImplBase-style server classes are generated. This custom naming scheme is applied only to the skeleton files, it doesn't affect any TIE delegates (use the -tieName option to customize these).


-td < path>

The given path should be used as the destination for the generated Java source files. If a Java class is mapped to a Java package, the compiler automatically creates subdirectories in the given destination to store the Java files. If this option isn't used, the compiler generates the Java files in the current directory.


-tieName < prefix>%< postfix>

This option allows you to customize the name of generated TIE delegates, where % represents the name of the IDL interface being mapped. If you have an IDL file containing an interface named PrintServer, the following:

     > idlj -fallTIE -tieName foo%bar servers.idl

generates a TIE delegate class named fooPrintServerbar, in a file of the same name. By default, TIE delegate classes are named <interfaceName>POATie if POA-compliant server classes are generated; they are named <interfaceName>_Tie if ImplBase-style server classes are generated. This naming scheme is applied only to the TIE files; it doesn't affect any skeletons. Use the -skeletonName option to customize these.


-verbose

Runs the compiler in verbose mode, printing out progress messages as the IDL is parsed.


-version

Prints the version information for idlj. The compiler doesn't compile any files when this option is specified; it simply prints the version and exits.



Java Enterprise in a Nutshell
Java Enterprise in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596101422
EAN: 2147483647
Year: 2004
Pages: 269

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net