![]() |
![]() |
|
|
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).
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.
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.
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|