1 <!doctype html>
   2 <html lang="en">
   3 <head>
   4    <meta http-equiv="Content-Type" content="text/html">
   5    <title>IDL-to-Java Generated Files</title>
   6 </head>
   7 <body>
   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 
  12 the <em><a href="http://www.omg.org/cgi-bin/doc?ptc/00-01-08">
  13 IDL-to-Java Language Mapping Specification</a></em>,
  14 which is implemented in Java&trade; SE 6 
  15 according the <a href="compliance.html">compliance</a> document.
  16 
  17 
  18 <P>In general IDL names and identifiers are mapped to Java names 
  19 and identifiers with no change. Because of the nature of the Java language,
  20 a single IDL construct may be mapped to several (differently named) Java constructs.
  21 The additional names are constructed by appending a descriptive suffix.
  22 For example, the IDL interface <code>foo</code> is mapped to the Java
  23 interfaces <code>foo</code> and <code>fooOperations</code>, and additional
  24 Java classes <code>fooHelper</code>, <code>fooHolder</code>, <code>fooPOA</code>,
  25 and 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>,
  32 where <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>,
  34 where <code>&lt;type&gt;</code>
  35 is 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>
  37 is 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>,
  39 and <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>
  41 is 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.
  48 These include <code>Any</code> insert and extract operations for the type,
  49 getting the repository id, getting the typecode, and reading
  50 and writing the type from and to a stream.
  51 
  52 <P>The helper class for a mapped IDL interface or abstract interface also
  53 include narrow operation(s). The static narrow method allows an <code>org.omg.CORBA.Object</code>
  54 to be narrowed to the object reference of a more specific type.
  55 The IDL exception <code>CORBA::BAD_PARAM</code> is thrown if the narrow fails because
  56 the object reference does not support the requested type. A different system exception
  57 is raised to indicate other kinds of errors. Trying to narrow
  58 a 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.
  63 These classes are available for all of the basic IDL datatypes in the <code>org.omg.CORBA</code> package
  64 and 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
  66 such 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
  69 a public instance member, <code>value</code> which is the typed value. The default constructor
  70 sets the value field to the default value for the type as defined by the Java language:
  71 false 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
  74 the <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:
  80 a <em>signature</em> interface and an <em>operations</em> interface.
  81 The signature interface, which extends <code>IDLEntity</code>, has the same
  82 name as the IDL interface name and is used
  83 as the signature type in method declarations
  84 when interfaces of the specified type are used in other interfaces.
  85 The operations interface has the same name as the IDL interface
  86 with the suffix <code>Operations</code>
  87 appended to the end and is used in the server-side mapping and as a mechanism
  88 for providing optimized calls for collocated client and servers.
  89 
  90 <P>The Java operations interface contains the mapped operation signatures.
  91 The Java signature interface extends the operations interface,
  92 the (mapped) base <code>org.omg.CORBA.Object</code>,
  93 as well as <code>org.omg.portable.IDLEntity</code>.
  94 Methods can be invoked on the signature interface. Interface inheritance
  95 expressed in IDL is reflected in both the Java signature
  96 interface 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
 102 a programming interface to the stubs for each interface type. Generally, the stubs
 103 will present access to the OMG IDL-defined operations on an object in a way that is easy
 104 for programmers to predict once they are familiar with OMG IDL and the language mapping
 105 for the particular programming language. The stubs make calls on the rest of the ORB
 106 using interfaces that are private to, and presumably optimized for, the particular ORB Core.
 107 If more than one ORB is available, there may be different stubs
 108 corresponding to the different ORBs. In this case, it is necessary for
 109 the ORB and language mapping to cooperate to associate
 110 the correct stubs with the particular object reference.
 111 
 112 <P>Object-oriented programming languages, such as Java,
 113 C++, and Smalltalk, do not require stub interfaces.
 114 
 115 <BR><BR>
 116 
 117 </body>
 118 </html>