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