Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4491742
Votes 0
Synopsis Missing Dynamic.Any.*Helper classes [Corba 2.3 compliance]
Category idl:orb
Reported Against merlin-beta
Release Fixed merlin-beta3
State 11-Closed, Verified, bug
Priority: 3-Medium
Related Bugs
Submit Date 14-AUG-2001
Description




java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b65)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b65, mixed mode)

The following standard CORBA dynamic any helper classes are
not included in the J2SE distribution:

org.omg.DynamicAny.DynStructHelper
org.omg.DynamicAny.DynSequenceHelper
org.omg.DynamicAny.DynArrayHelper
org.omg.DynamicAny.DynUnionHelper
org.omg.DynamicAny.DynEnumHelper
org.omg.DynamicAny.DynAnyFactoryHelper

----------------

further commentary from user:

These Helpers are mandated by the CORBA 2.3 spec. If you read 99-10-07 chapter 9
covers the implementation of dynamic anys. From the first paragraph at the top of
page 213 (in section 9.2.2):

"The create_dyn_any_from_type_code operation creates a DynAny from a
TypeCode. Depending on the TypeCode, the created  customer  may be of type
DynAny, or one of its derived types, such as DynStruct. The returned reference can
be narrowed to the derived type."

And the last two paragraphs:

"Dynamic interpretation of an any usually involves creating a DynAny  customer  using
DynAnyFactory::create_dyn_any as the first step. Depending on the type of the
any, the resulting DynAny  customer  reference can be narrowed to a DynFixed,
DynStruct, DynSequence, DynArray, DynUnion, DynEnum, or DynValue
 customer  reference.

Dynamic creation of an any involves creating a DynAny  customer  using
DynAnyFactory::create_dyn_any_from_type_code, passing the TypeCode
associated with the value to be created. The returned reference is narrowed to one of
the complex types, such as DynStruct, if appropriate. Then, the value can be
initialized by means of invoking operations on the resulting  customer . Finally, the to_any
operation can be invoked to create an any value from the constructed DynAny."

The important thing here is the description of how the narrow operation is used. In
the Java bainding narrow operations are supported on the Helper class i.e. the various
dynamic helper classes are mandated by the spec.

To create say a DynStruct from an appropriate TypeCode you would do somethink like
the following:

// Get initial dynamic any factory

org.omg.CORBA.Object obj = orb.resolve_initial_references ("DynAnyFactory");
org.omg.DynamicAny.DynAnyFactory factory = org.omg.DynamicAny.DynAnyFactoryHelper.narrow (obj);

// Create basic dynamic any from type code

TypeCode tc;
org.omg.DynamicAny.DynAny dAny = factory.create_dyn_any_from_type_code (tc);

// Narrow to dynamic struct

org.omg.DynamicAny.DynStruct dStruct = org.omg.DynamicAny.DynStructHelper.narrow (dAny);

This is the standard way to create all of the various dynamic support classes (DynStruct,
DynArray, DynUnion, DynSequence, DynEnum, etc). Without the Helper classes this cannot
be done.

(Review ID: 126508) 
======================================================================

**************************************************************************
  xxxxx@xxxxx   2001-12-03

Fix Verified OK:

- With build: j2sdk-1_4_0-rc-bin-b88-solsparc-28_nov_2001
- With tests:
    /java/idl/ws/rip/RIP_TEST_MASTER/tests/api/dynany/bug4491742
**************************************************************************
Work Around




None
======================================================================
Evaluation
Will be fixed for Merlin for Spec Compliance.


  xxxxx@xxxxx   2001-08-14
----
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang