BEA Logo BEA WebLogic Enterprise Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WLE Doc Home   |   idltojava Compiler and Related Topics   |   Previous   |   Next   |   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 WebLogic Enterprise (WLE) idltojava compiler, see the topic How does the BEA idltojava compiler differ from the Sun Microsystems, Inc. version?

Syntax of the idltojava Command

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

m3idltojava [ 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 command m3idltojava is used to translate IDL into generic client stubs and WebLogic Enterprise server skeletons.

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, use the following command:

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

The idltojava command requires a C++ pre-processor, and is used to generate deprecated names. The command idltojava generates Java code as is appropriate for the client-side 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 WLE server. Neither the client nor the server has any of the WLE administrative and infrastructure components, such as tmadmin , JNDI registration, and ISL/ISH (hence, none of scalability and reliability attributes of WLE)

Running m3idltojava on Server Side IDL Files

To run m3idltojava on server-side IDL files, use the following command:

m3idltojava <flags> <options> <idl-files>

The server-side ORB is built to use non-deprecated names. The command m3idltojava generates Java code using non-deprecated names as is appropriate for the server-side ORB.

idltojava Command Options

Note: Several option descriptions have been added here that are not documented in the original Sun Microsystems Inc. idltojava compiler documentation.

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. 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):

-I directory

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

-D symbol

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

-U symbol

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 .

The table below includes descriptions of all flags.

Flag

Description

-f list-flags

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

-f list -debug-flags

Provides a list of debugger flags

-f caseless

Request that case not be significant in keywords and identifiers. The default value of this flag is 'on'.

-f client

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

-f cpp

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 .

-f ignore-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 .

-f list-options

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

-f map-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.

-f server

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

-f verbose

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

-f version

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

-f warn-pragma

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

-f write-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.

Using #pragma in IDL Files

Note: The BEA WLE 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.