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

IDL to Java Mappings Used By the idltojava Compiler

The idltojava tool reads an OMG IDL interface and translates or maps it to a Java interface. idltojava also creates stub, skeleton, helper, holder, and other files as necessary. These .java files are generated from the IDL file according to the mapping specified in the OMG document IDL/Java Language Mapping.

For more information on the IDL to Java mappings, refer to the OMG Web Site at http://www.omg.org.

CORBA objects are defined in OMG IDL (Object Management Group Interface Definition Language). Before they can be used by a Java developer, their interfaces must be mapped to Java classes and interfaces. The idltojava tool performs this mapping automatically.

Table 5-1 shows the correspondence between OMG IDL constructs and Java constructs. Note that OMG IDL, as its name implies, defines interfaces. Like Java interfaces, IDL interfaces contain no implementations for their operations (methods in Java). In other words, IDL interfaces define only the signature for an operation (the name of the operation, the data type of its return value, the data types of the parameters that it takes, and any exceptions that it raises). The implementations for these operations need to be supplied in Java classes written by a Java programmer.

Table 5-1 IDL Constructs Mapped to Java Constructs

IDL Construct

Java Construct

module

package

interface

interface, helper class, holder class

constant

public static final

boolean

boolean

char, wchar

char

octet

byte

string, wstring

java.lang.String

short, unsigned short

short

long, unsigned long

int

long long, unsigned long long

long

float

float

double

double

enum, struct, union

class

sequence, array

array

exception

class

readonly attribute

method for accessing value of attrubite

readwrite attribute

methods for accessing and setting value of attribute

operation

method

Note: When a CORBA operation takes a type that corresponds to a Java object type (a String, for example), it is illegal to pass a Java null as the parameter value. Instead, pass an empty version of the designated object type (for example, an empty String or an empty array). A Java null can be passed as a parameter only when the type of the parameter is a CORBA object reference, in which case the null is interpreted as a nil CORBA object reference.