generatedfiles.html revision 890:d5fd6bd57a56
1<!doctype html>
2<html>
3<head>
4   <meta http-equiv="Content-Type" content="text/html">
5   <title>IDL-to-Java Generated Files</title>
6</head>
7<body bgcolor="#FFFFFF">
8
9<H1>IDL-to-Java Generated Files</H1>
10
11<P>The files that are generated by the IDL-to-Java compiler, in accordance with 
12the <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
13IDL-to-Java Language Mapping Specification</a></em>,
14which is implemented in Java<sup><font size="-2">TM</font></sup> SE 6 
15according the <a href="compliance.html">compliance</a> document.
16
17
18<P>In general IDL names and identifiers are mapped to Java names 
19and identifiers with no change. Because of the nature of the Java language,
20a single IDL construct may be mapped to several (differently named) Java constructs.
21The additional names are constructed by appending a descriptive suffix.
22For example, the IDL interface <code>foo</code> is mapped to the Java
23interfaces <code>foo</code> and <code>fooOperations</code>, and additional
24Java classes <code>fooHelper</code>, <code>fooHolder</code>, <code>fooPOA</code>,
25and optionally <code>fooPOATie</code>.
26
27
28
29<P>The mapping in effect reserves the use of several names for its own purposes. These are:
30<UL>
31<LI>The Java class <a href="#helper"><code>&lt;type&gt;Helper</code></a>,
32where <code>&lt;type&gt;</code> is the name of an IDL defined type.
33<LI>The Java class <a href="#holder"><code>&lt;type&gt;Holder</code></a>,
34where <code>&lt;type&gt;</code>
35is the name of an IDL defined type (with certain exceptions such as <code>typedef</code> aliases).
36<LI>The Java classes <code>&lt;basicJavaType&gt;Holder</code>, where <code>&lt;basicJavaType&gt;</code>
37is one of the Java primitive datatypes that is used by one of the IDL basic datatypes.
38<LI>The Java classes <a href="#operations"><code>&lt;interface&gt;Operations</code></a>, <code>&lt;interface&gt;POA</code>,
39and <code>&lt;interface&gt;POATie</code>, where <code>&lt;interface&gt;</code> is the name of an IDL interface type.
40<LI>The nested scope Java package name <code>&lt;interface&gt;Package</code>, where <code>&lt;interface&gt;</code>
41is the name of an IDL interface.
42</UL>
43
44
45<H2><a id="helper">Helper Files</a></H2>
46
47<P>Helper files supply several static methods needed to manipulate the type.
48These include <code>Any</code> insert and extract operations for the type,
49getting the repository id, getting the typecode, and reading
50and writing the type from and to a stream.
51
52<P>The helper class for a mapped IDL interface or abstract interface also
53include narrow operation(s). The static narrow method allows an <code>org.omg.CORBA.Object</code>
54to be narrowed to the object reference of a more specific type.
55The IDL exception <code>CORBA::BAD_PARAM</code> is thrown if the narrow fails because
56the object reference does not support the requested type. A different system exception
57is raised to indicate other kinds of errors. Trying to narrow
58a null will always succeed with a return value of null.
59
60<H2><a id="holder">Holder Files</a></H2>
61
62<P>Support for out and inout parameter passing modes requires the use of additional holder classes.
63These classes are available for all of the basic IDL datatypes in the <code>org.omg.CORBA</code> package
64and are generated for all named user defined IDL types except those defined by typedefs.
65(Note that in this context user defined includes types that are defined in OMG specifications
66such as those for the Interface Repository, and other OMG services.)
67
68<P>Each holder class has a constructor from an instance, a default constructor, and has
69a public instance member, <code>value</code> which is the typed value. The default constructor
70sets the value field to the default value for the type as defined by the Java language:
71false for boolean, 0 for numeric and char types, null for strings, null for object references.
72
73<P>To support portable stubs and skeletons, holder classes also implement
74the <code>org.omg.CORBA.portable.Streamable</code> interface.
75
76
77<H2><a id="operations">Operations Files</a></H2>
78
79<P>A non abstract IDL interface is mapped to two public Java interfaces:
80a <em>signature</em> interface and an <em>operations</em> interface.
81The signature interface, which extends <code>IDLEntity</code>, has the same
82name as the IDL interface name and is used
83as the signature type in method declarations
84when interfaces of the specified type are used in other interfaces.
85The operations interface has the same name as the IDL interface
86with the suffix <code>Operations</code>
87appended to the end and is used in the server-side mapping and as a mechanism
88for providing optimized calls for collocated client and servers.
89
90<P>The Java operations interface contains the mapped operation signatures.
91The Java signature interface extends the operations interface,
92the (mapped) base <code>org.omg.CORBA.Object</code>,
93as well as <code>org.omg.portable.IDLEntity</code>.
94Methods can be invoked on the signature interface. Interface inheritance
95expressed in IDL is reflected in both the Java signature
96interface and operations interface hierarchies.
97
98
99<H2><a id="stub">Stubs</a></H2>
100
101<P>For the mapping of a non-object-oriented language, there will be
102a programming interface to the stubs for each interface type. Generally, the stubs
103will present access to the OMG IDL-defined operations on an object in a way that is easy
104for programmers to predict once they are familiar with OMG IDL and the language mapping
105for the particular programming language. The stubs make calls on the rest of the ORB
106using interfaces that are private to, and presumably optimized for, the particular ORB Core.
107If more than one ORB is available, there may be different stubs
108corresponding to the different ORBs. In this case, it is necessary for
109the ORB and language mapping to cooperate to associate
110the correct stubs with the particular object reference.
111
112<P>Object-oriented programming languages, such as Java,
113C++, and Smalltalk, do not require stub interfaces.
114
115<BR><BR>
116
117</body>
118</html>
119