generatedfiles.html revision 704:3ef63dbde965
11553Srgrimes<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
21553Srgrimes<html>
31553Srgrimes<head>
41553Srgrimes   <meta http-equiv="Content-Type" content="text/html">
51553Srgrimes   <title>IDL-to-Java Generated Files</title>
61553Srgrimes</head>
71553Srgrimes<body bgcolor="#FFFFFF">
81553Srgrimes
91553Srgrimes<H1>IDL-to-Java Generated Files</H1>
101553Srgrimes
111553Srgrimes<P>The files that are generated by the IDL-to-Java compiler, in accordance with 
121553Srgrimesthe <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
131553SrgrimesIDL-to-Java Language Mapping Specification</a></em>,
141553Srgrimeswhich is implemented in Java<sup><font size="-2">TM</font></sup> SE 6 
151553Srgrimesaccording the <a href="compliance.html">compliance</a> document.
161553Srgrimes
171553Srgrimes
181553Srgrimes<P>In general IDL names and identifiers are mapped to Java names 
191553Srgrimesand identifiers with no change. Because of the nature of the Java language,
201553Srgrimesa single IDL construct may be mapped to several (differently named) Java constructs.
211553SrgrimesThe additional names are constructed by appending a descriptive suffix.
221553SrgrimesFor example, the IDL interface <code>foo</code> is mapped to the Java
231553Srgrimesinterfaces <code>foo</code> and <code>fooOperations</code>, and additional
241553SrgrimesJava classes <code>fooHelper</code>, <code>fooHolder</code>, <code>fooPOA</code>,
251553Srgrimesand optionally <code>fooPOATie</code>.
261553Srgrimes
271553Srgrimes
281553Srgrimes
291553Srgrimes<P>The mapping in effect reserves the use of several names for its own purposes. These are:
301553Srgrimes<UL>
311553Srgrimes<LI>The Java class <a href="#helper"><code>&lt;type&gt;Helper</code></a>,
321553Srgrimeswhere <code>&lt;type&gt;</code> is the name of an IDL defined type.
331553Srgrimes<LI>The Java class <a href="#holder"><code>&lt;type&gt;Holder</code></a>,
341553Srgrimeswhere <code>&lt;type&gt;</code>
351553Srgrimesis the name of an IDL defined type (with certain exceptions such as <code>typedef</code> aliases).
3629780Scharnier<LI>The Java classes <code>&lt;basicJavaType&gt;Holder</code>, where <code>&lt;basicJavaType&gt;</code>
371553Srgrimesis one of the Java primitive datatypes that is used by one of the IDL basic datatypes.
381553Srgrimes<LI>The Java classes <a href="#operations"><code>&lt;interface&gt;Operations</code></a>, <code>&lt;interface&gt;POA</code>,
391553Srgrimesand <code>&lt;interface&gt;POATie</code>, where <code>&lt;interface&gt;</code> is the name of an IDL interface type.
401553Srgrimes<LI>The nested scope Java package name <code>&lt;interface&gt;Package</code>, where <code>&lt;interface&gt;</code>
411553Srgrimesis the name of an IDL interface.
4229780Scharnier</UL>
4315648Sjoerg
4429780Scharnier
4529780Scharnier<H2><a name="helper">Helper Files</a></H2>
4630143Simp
471553Srgrimes<P>Helper files supply several static methods needed to manipulate the type.
481553SrgrimesThese include <code>Any</code> insert and extract operations for the type,
491553Srgrimesgetting the repository id, getting the typecode, and reading
501553Srgrimesand writing the type from and to a stream.
511553Srgrimes
521553Srgrimes<P>The helper class for a mapped IDL interface or abstract interface also
531553Srgrimesinclude narrow operation(s). The static narrow method allows an <code>org.omg.CORBA.Object</code>
541553Srgrimesto be narrowed to the object reference of a more specific type.
551553SrgrimesThe IDL exception <code>CORBA::BAD_PARAM</code> is thrown if the narrow fails because
561553Srgrimesthe object reference does not support the requested type. A different system exception
571553Srgrimesis raised to indicate other kinds of errors. Trying to narrow
581553Srgrimesa null will always succeed with a return value of null.
591553Srgrimes
601553Srgrimes<H2><a name="holder">Holder Files</a></H2>
611553Srgrimes
621553Srgrimes<P>Support for out and inout parameter passing modes requires the use of additional holder classes.
631553SrgrimesThese classes are available for all of the basic IDL datatypes in the <code>org.omg.CORBA</code> package
641553Srgrimesand are generated for all named user defined IDL types except those defined by typedefs.
651553Srgrimes(Note that in this context user defined includes types that are defined in OMG specifications
661553Srgrimessuch as those for the Interface Repository, and other OMG services.)
671553Srgrimes
681553Srgrimes<P>Each holder class has a constructor from an instance, a default constructor, and has
691553Srgrimesa public instance member, <code>value</code> which is the typed value. The default constructor
701553Srgrimessets the value field to the default value for the type as defined by the Java language:
711553Srgrimesfalse for boolean, 0 for numeric and char types, null for strings, null for object references.
7227748Simp
731553Srgrimes<P>To support portable stubs and skeletons, holder classes also implement
741553Srgrimesthe <code>org.omg.CORBA.portable.Streamable</code> interface.
7527748Simp
761553Srgrimes
771553Srgrimes<H2><a name="operations">Operations Files</a></H2>
781553Srgrimes
791553Srgrimes<P>A non abstract IDL interface is mapped to two public Java interfaces:
801553Srgrimesa <em>signature</em> interface and an <em>operations</em> interface.
811553SrgrimesThe signature interface, which extends <code>IDLEntity</code>, has the same
821553Srgrimesname as the IDL interface name and is used
831553Srgrimesas the signature type in method declarations
841553Srgrimeswhen interfaces of the specified type are used in other interfaces.
851553SrgrimesThe operations interface has the same name as the IDL interface
861553Srgrimeswith the suffix <code>Operations</code>
871553Srgrimesappended to the end and is used in the server-side mapping and as a mechanism
881553Srgrimesfor providing optimized calls for collocated client and servers.
891553Srgrimes
901553Srgrimes<P>The Java operations interface contains the mapped operation signatures.
911553SrgrimesThe Java signature interface extends the operations interface,
921553Srgrimesthe (mapped) base <code>org.omg.CORBA.Object</code>,
931553Srgrimesas well as <code>org.omg.portable.IDLEntity</code>.
941553SrgrimesMethods can be invoked on the signature interface. Interface inheritance
951553Srgrimesexpressed in IDL is reflected in both the Java signature
961553Srgrimesinterface and operations interface hierarchies.
971553Srgrimes
981553Srgrimes
991553Srgrimes<H2><a name="stub">Stubs</a></H2>
1001553Srgrimes
10127748Simp<P>For the mapping of a non-object-oriented language, there will be
1021553Srgrimesa programming interface to the stubs for each interface type. Generally, the stubs
1031553Srgrimeswill present access to the OMG IDL-defined operations on an object in a way that is easy
1041553Srgrimesfor programmers to predict once they are familiar with OMG IDL and the language mapping
1051553Srgrimesfor the particular programming language. The stubs make calls on the rest of the ORB
1061553Srgrimesusing interfaces that are private to, and presumably optimized for, the particular ORB Core.
1071553SrgrimesIf more than one ORB is available, there may be different stubs
1081553Srgrimescorresponding to the different ORBs. In this case, it is necessary for
1091553Srgrimesthe ORB and language mapping to cooperate to associate
1101553Srgrimesthe correct stubs with the particular object reference.
1111553Srgrimes
1121553Srgrimes<P>Object-oriented programming languages, such as Java,
1131553SrgrimesC++, and Smalltalk, do not require stub interfaces.
1141553Srgrimes
1151553Srgrimes<BR><BR>
1161553Srgrimes
1171553Srgrimes</body>
1181553Srgrimes</html>
1191553Srgrimes