Issue 2476: IDLEntity types need to be boxed (java2idl-rtf) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: When IDLEntity types are mapped from Java to IDL, they need to be mapped as valuetypes to preserve RMI null and sharing semantics. For most IDLEntity types, this will require the generation of boxed valuetypes in IDL, similarly to the mapping of Java arrays to IDL boxed sequences. Resolution: Closed, accepted Revised Text: 28.2.1 add two new bullets - is a conforming CORBA object reference (see section 28.2.7) - is a conforming IDL entity (see section 28.2.8) Add new section 28.2.7 CORBA Object References A conforming CORBA object reference is either - the Java interface org.omg.CORBA.Object or - a Java interface that extends org.omg.CORBA.Object directly or indirectly and conforms to the rules specified in the Java Language mapping (i.e., could have been generated by applying the mapping to an IDL definition). Add new section 28.2.8 IDL Entities A Java class is a conforming RMI/IDL type if it extends org.omg.CORBA.portable.IDLEntity and conforms to the rules specified in the Java Language mapping (i.e., could have been generated by applying the mapping to an IDL definition), and is not an IDL user exception. Add 2 new bullets to 28.3.1 after the 5th bullet - RMI/IDL exceptions - CORBA object references - IDL entities Renumber the following sections as below: 28.3.8->28.3.10, 28.3.9->28.3.11, 28.3.10->28.3.12 Change section 28.3.6 globally replace ::org::omg::sequences with ::org::omg::boxedRMI and org_omg_sequences with org_omg_boxedRMI After the fourth paragraph, insert a new paragraph: For each "boxed" value type generated for a Java array, a #pragma ID is generated to specify an RMI Hashed Format repository ID for the IDL type. In the example in section 28.3.6.2, add the following line: #pragma ID seq1_Dolphin "RMI:[Lomega.Dolphin;:ABCDEF0123456789" Add new section 28.3.8 Mapping CORBA Object References A CORBA object reference is mapped directly to its corresponding IDL interface or to Object if it is org.omg.CORBA.Object. Add new section 28.3.9 Mapping IDL Entities An IDL entity that is not a CORBA object reference is mapped to a "boxed" value type containing the IDL entity. The containing module for the boxed IDL entity is determined by the IDL entity's container. A module name is formed by taking the ::org::omg::boxedIDL prefix and appending the IDL entity's container's fully scoped name. A boxed value type corresponding to the IDL entity is defined within this module. The name of the value type is the same as the name of the IDL definition it is boxing. For example, assume we have the following IDL and the Java class that results from applying the forward mapping: // IDL module hello { struct world { short x; }; }; // Java package hello; public final class world implements org.omg.CORBA.portable.IDLEntity { ... } Now assume that hello.world is used as an argument to a method or as a member of an RMI/IDL value type. The Java class hello.world is mapped as follows: hello.world ==> in the module ::org::omg::boxedIDL::hello define valuetype world ::hello::world; #pragma ID world "RMI:[Lhello.world;:1234567890ABCDEF" The exact mechanism by which the IDL for ::hello::world is created is a tools issue and is not specified. (Note to rtf: Specifying a conversion algorithm will effectively require creating a reversible mapping, which is not the intent of this proposal. There are many ways this can be achieved. One mechanism would be to pass the original IDL file in the command line of the tool, and read the definitions from the IDL file.) Preprocessor guards are placed for these definitions in the same way as they are done for mapping arrays. Add new section 28.4.7 (move all sections from 28.4.7 up by one). 28.4.7 Marshaling IDL entities Marshaling and demarshaling of IDL entities is done by calling write_Value(java.io.Serializable) and read_Value() on the portable output and input streams respectively. Actions taken: February 22, 1999: received issue June 4, 1999: closed issue Discussion: End of Annotations:===== Date: Mon, 22 Feb 1999 11:55:37 +0000 From: Simon Nash Organization: IBM To: issues CC: java2idl Subject: IDLEntity types need to be boxed When IDLEntity types are mapped from Java to IDL, they need to be mapped as valuetypes to preserve RMI null and sharing semantics. For most IDLEntity types, this will require the generation of boxed valuetypes in IDL, similarly to the mapping of Java arrays to IDL boxed sequences. Simon -- Simon C Nash, Technology Architect, IBM Java Technology Centre Tel. +44-1962-815156 Fax +44-1962-818999 Hursley, England Internet: nash@hursley.ibm.com Lotus Notes: Simon Nash@ibmgb