BEA Logo BEA BEA Tuxedo Release [Release Number]

  BEA Home  |  Events  |  Solutions  |  Partners  |  Products  |  Services  |  Download  |  Developer Center  |  WebSUPPORT

 

   BEA Tuxedo Doc Home   |   Using the CORBA Idltojava Compiler   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Using the idltojava Command

 

The idltojava compiler compiles IDL files to Java source code based on IDL-to-Java mappings defined by the OMG. For more information about the IDL-to-Java mappings, refer to the topic IDL-to-Java Mappings Used By the idltojava Compiler.

This topic includes the following sections:

For a quick summary of the enhancements and updates added to the BEA Tuxedo idltojava compiler, see the topic Overview of idltojava Compiler.

 


Syntax of the idltojava Command

The following is an example of the idltojava command syntax:

idltojava [idltojava Command Flags] [idltojava Command Options] filename ...

 


idltojava Command Description

The idltojava command compiles IDL source code into Java source code. You then use the javac compiler to compile that source to Java bytecodes.The command idltojava is used to translate IDL source code into generic client stubs and generic server skeletons which can be used for callbacks.

The IDL declarations from the named IDL files are translated to Java declarations according to the mappings specified in the OMG IDL-to-Java mappings. (For more information on the mappings, see IDL-to-Java Mappings Used By the idltojava Compiler.)

 


Running idltojava on Client or Joint Client/Server IDL Files

To run idltojava on client-side IDL files for either CORBA Java clients or CORBA Java joint client/servers, use the following command:

idltojava <flags> <options> <idl-files>

The idltojava command requires a C++ preprocessor, and is used to generate deprecated names. The command idltojava generates Java code as is appropriate for the Java client ORB.

Note: A remote joint client/server is a client that implements server objects to be used as callback objects. The server role of the remote joint client/server is considerably less robust than that of a BEA Tuxedo server. For more information about joint client/servers, see Using CORBA Server-to-Server Communication.

 


idltojava Command Options

Note: Several option descriptions have been added here that are not documented in the original Sun Microsystems, Inc. idltojava compiler documentation (see Table 2-1).

Table 2-1 idltojava Added Options

Option

Description

-j javaDirectory

Specifies that generated Java files should be written to the given directory. This directory is independent of the -p option, if any.

-J filesFile

Specifies that a list of the files generated by idltojava should be written to filesFile.

-p package-name

Specifies the name of an outer package to enclose all the generated Java files. It has the same function as #pragma javaPackage.

Note: You must include an outer package. The compiler does not do this for you. If you do not have an outer package, the idltojava compiler will still generate Java files for you but you will get a Java compiler error when you try to compile the *.java files.

The following options are identical to the equivalent C/C++ compiler options (cpp):

-Idirectory

Specifies a directory or path to be searched for files that are #included in IDL files. This option is passed to the preprocessor.

-Dsymbol

Specifies a symbol to be defined during preprocessing of the IDL files. This option is passed to the preprocessor.

-Usymbol

Specifies a symbol to be undefined during preprocessing of the IDL files. This option is passed to the preprocessor.


 

 


idltojava Command Flags

The flags can be turned on by specifying them as shown, and they can be turned off by prefixing them with the letters no-. For example, to prevent the C preprocessor from being run on the input IDL files, use -fno-cpp.

Table 2-2 includes descriptions of all flags.

Table 2-2 idltojava Command Flags

Flag

Description

-flist-flags

Requests that the state of all the -f flags be printed. The default value of this flag is off.

-flist -debug-flags

Provides a list of debugger flags.

-fcaseless

Requests that the use of upper- and lowercase letters in keywords and identifiers not be significant. Note that this does not mean that case is ignored, because all uses of an identifier must have the same use of case as the initial usage. For example, "Session" and "session" are the same identifier, but using "session" after an initial use of "Session" results in an error because "session" does not have the case as "Session." CORBA uses this definition of caseless to allow accurate mappings to case-sensitive languages. The default value of this flag is on. The severity of identifier conflicts found with this flag specified is warning (the default). See the -fstrict flag for more information.

-fclient

Requests the generation of the client side of the IDL files supplied. The default value of this flag is on.

-fcpp

Requests that the IDL source be run through the C/C++ preprocessor before being compiled by the idltojava compiler. The default value of this flag is on.

-fignore-duplicates

Specifies that duplicate definitions be ignored. This may be useful if compiling multiple IDL files at one time. The default value of this flag is off.

-flist-options

Lists the options specified on the command line. The default value of this flag is off.

-fmap-included-files

Specifies that Java files be generated for definitions included by #include preprocessor directives. The default value for this flag is off, which specifies that the Java files for included definitions not be generated.

-fserver

Requests the generation of the server side of the IDL files supplied. The default value of this flag is on.

-fverbose

Requests that the compiler comment on the progress of the compilation. The default value of this flag is off.

-fversion

Requests that the compiler print its version and timestamp. The default value of this flag is off.

-fwarn-pragma

Requests that warning messages be issued for unknown or improperly specified #pragmas. The default value of this flag is on.

-fwrite-files

Requests that the derived Java files be written. The default value of this flag is on. You might specify -fno-write-files if you wished to check for errors without actually writing the files.

-fstrict

In previous releases, the severity of identifier conflicts found with the -fcaseless flag specified was error. In this release, the -fcaseless flag performs its identifier comparisons exactly as before but the severity of the conflicts has changed from error to warning. To request the previous, strict CORBA conformance which requires identifier conflicts to be specified as error, specify this flag with the -fcaseless flag.


 

 


Using #pragma in IDL Files

Note: The BEA Tuxedo idltojava compiler processes #pragma somewhat differently from the Sun Microsystems, Inc. idltojava compiler.

RepositoryPrefix="prefix"

A default repository prefix can also be requested with the line #pragma prefix "requested prefix" at the top-level in the IDL file itself. The line:

#pragma javaPackage "package"

wraps the default package in one called package. For example, compiling an IDL module M normally creates a Java package M. If the module declaration is preceded by:

#pragma javaPackage browser

the compiler will create the package M inside package browser. This pragma is useful when the definitions in one IDL module will be used in multiple products. The command-line option -p can be used to achieve the same result. The line:

#pragma ID scoped-name "IDL:<path>:<version>"

specifies the repository ID of the identifier scoped-name. This pragma may appear anywhere in an IDL file. If the pragma appears inside a complex type, such as structure or union, then only as much of scoped-name need be specified to specify the element. A scoped-name is of the form outer_name::name::inner_name. The <path>component of the repository ID is a series of identifiers separated by forward slashes (/). The <version> component is a decimal number MM.mm, where MM is the major version number and mm is the minor version number.

 

back to top previous page next page