generatedfiles.html revision 877:a3e210a93f90
12311Sjkh<!doctype html>
22311Sjkh<html>
32311Sjkh<head>
42311Sjkh   <meta http-equiv="Content-Type" content="text/html">
52311Sjkh   <title>IDL-to-Java Generated Files</title>
62311Sjkh</head>
72311Sjkh<body bgcolor="#FFFFFF">
82311Sjkh
92311Sjkh<H1>IDL-to-Java Generated Files</H1>
102311Sjkh
112311Sjkh<P>The files that are generated by the IDL-to-Java compiler, in accordance with 
122311Sjkhthe <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
132311SjkhIDL-to-Java Language Mapping Specification</a></em>,
142311Sjkhwhich is implemented in Java<sup><font size="-2">TM</font></sup> SE 6 
152311Sjkhaccording the <a href="compliance.html">compliance</a> document.
162311Sjkh
172311Sjkh
182311Sjkh<P>In general IDL names and identifiers are mapped to Java names 
1929452Scharnierand identifiers with no change. Because of the nature of the Java language,
2050479Spetera single IDL construct may be mapped to several (differently named) Java constructs.
212311SjkhThe additional names are constructed by appending a descriptive suffix.
222311SjkhFor example, the IDL interface <code>foo</code> is mapped to the Java
232311Sjkhinterfaces <code>foo</code> and <code>fooOperations</code>, and additional
242311SjkhJava classes <code>fooHelper</code>, <code>fooHolder</code>, <code>fooPOA</code>,
252311Sjkhand optionally <code>fooPOATie</code>.
262311Sjkh
27199804Sattilio
282311Sjkh
292311Sjkh<P>The mapping in effect reserves the use of several names for its own purposes. These are:
302311Sjkh<UL>
312311Sjkh<LI>The Java class <a href="#helper"><code>&lt;type&gt;Helper</code></a>,
322311Sjkhwhere <code>&lt;type&gt;</code> is the name of an IDL defined type.
332311Sjkh<LI>The Java class <a href="#holder"><code>&lt;type&gt;Holder</code></a>,
342311Sjkhwhere <code>&lt;type&gt;</code>
352311Sjkhis the name of an IDL defined type (with certain exceptions such as <code>typedef</code> aliases).
36173412Skevlo<LI>The Java classes <code>&lt;basicJavaType&gt;Holder</code>, where <code>&lt;basicJavaType&gt;</code>
37173412Skevlois one of the Java primitive datatypes that is used by one of the IDL basic datatypes.
38242101Ssobomax<LI>The Java classes <a href="#operations"><code>&lt;interface&gt;Operations</code></a>, <code>&lt;interface&gt;POA</code>,
39242101Ssobomaxand <code>&lt;interface&gt;POATie</code>, where <code>&lt;interface&gt;</code> is the name of an IDL interface type.
40242101Ssobomax<LI>The nested scope Java package name <code>&lt;interface&gt;Package</code>, where <code>&lt;interface&gt;</code>
41173412Skevlois the name of an IDL interface.
422311Sjkh</UL>
43173412Skevlo
442311Sjkh
45173412Skevlo<H2><a name="helper">Helper Files</a></H2>
46173412Skevlo
472311Sjkh<P>Helper files supply several static methods needed to manipulate the type.
48242101SsobomaxThese include <code>Any</code> insert and extract operations for the type,
49346513Skevansgetting the repository id, getting the typecode, and reading
50242101Ssobomaxand writing the type from and to a stream.
51346513Skevans
5274010Sbabkin<P>The helper class for a mapped IDL interface or abstract interface also
5374010Sbabkininclude narrow operation(s). The static narrow method allows an <code>org.omg.CORBA.Object</code>
54308258Straszto be narrowed to the object reference of a more specific type.
55149430SpjdThe IDL exception <code>CORBA::BAD_PARAM</code> is thrown if the narrow fails because
562311Sjkhthe object reference does not support the requested type. A different system exception
572311Sjkhis raised to indicate other kinds of errors. Trying to narrow
582311Sjkha null will always succeed with a return value of null.
59241124Spluknet
6016859Swosch<H2><a name="holder">Holder Files</a></H2>
61241124Spluknet
6216859Swosch<P>Support for out and inout parameter passing modes requires the use of additional holder classes.
63129280SyarThese classes are available for all of the basic IDL datatypes in the <code>org.omg.CORBA</code> package
64321236Sngieand are generated for all named user defined IDL types except those defined by typedefs.
65241124Spluknet(Note that in this context user defined includes types that are defined in OMG specifications
6616859Swoschsuch as those for the Interface Repository, and other OMG services.)
6716859Swosch
6816859Swosch<P>Each holder class has a constructor from an instance, a default constructor, and has
6916859Swoscha public instance member, <code>value</code> which is the typed value. The default constructor
7016859Swoschsets the value field to the default value for the type as defined by the Java language:
7116859Swoschfalse for boolean, 0 for numeric and char types, null for strings, null for object references.
72241124Spluknet
7316859Swosch<P>To support portable stubs and skeletons, holder classes also implement
742311Sjkhthe <code>org.omg.CORBA.portable.Streamable</code> interface.
752311Sjkh
762311Sjkh
77149430Spjd<H2><a name="operations">Operations Files</a></H2>
78149430Spjd
79149430Spjd<P>A non abstract IDL interface is mapped to two public Java interfaces:
80149430Spjda <em>signature</em> interface and an <em>operations</em> interface.
81149430SpjdThe signature interface, which extends <code>IDLEntity</code>, has the same
82149430Spjdname as the IDL interface name and is used
832311Sjkhas the signature type in method declarations
84149430Spjdwhen interfaces of the specified type are used in other interfaces.
85150214SpjdThe operations interface has the same name as the IDL interface
86149430Spjdwith the suffix <code>Operations</code>
87149430Spjdappended to the end and is used in the server-side mapping and as a mechanism
88149430Spjdfor providing optimized calls for collocated client and servers.
89149430Spjd
90149430Spjd<P>The Java operations interface contains the mapped operation signatures.
91149430SpjdThe Java signature interface extends the operations interface,
92149430Spjdthe (mapped) base <code>org.omg.CORBA.Object</code>,
93149430Spjdas well as <code>org.omg.portable.IDLEntity</code>.
94149430SpjdMethods can be invoked on the signature interface. Interface inheritance
95149430Spjdexpressed in IDL is reflected in both the Java signature
96149430Spjdinterface and operations interface hierarchies.
97149430Spjd
98149430Spjd
99149430Spjd<H2><a name="stub">Stubs</a></H2>
1002311Sjkh
1012311Sjkh<P>For the mapping of a non-object-oriented language, there will be
1022311Sjkha programming interface to the stubs for each interface type. Generally, the stubs
1032311Sjkhwill present access to the OMG IDL-defined operations on an object in a way that is easy
1042311Sjkhfor programmers to predict once they are familiar with OMG IDL and the language mapping
105242101Ssobomaxfor the particular programming language. The stubs make calls on the rest of the ORB
106242101Ssobomaxusing interfaces that are private to, and presumably optimized for, the particular ORB Core.
107242101SsobomaxIf more than one ORB is available, there may be different stubs
10871407Sbabkincorresponding to the different ORBs. In this case, it is necessary for
1092311Sjkhthe ORB and language mapping to cooperate to associate
1102311Sjkhthe correct stubs with the particular object reference.
1112311Sjkh
1122311Sjkh<P>Object-oriented programming languages, such as Java,
1132311SjkhC++, and Smalltalk, do not require stub interfaces.
1142311Sjkh
1152311Sjkh<BR><BR>
1162311Sjkh
1172311Sjkh</body>
1182311Sjkh</html>
1192311Sjkh