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