Package org.omg.DynamicAny

DynAny's allow to work with data structures, exact content of those is not known at the time of compilation.

Interface Summary

DynAny The DynAny interface provides possibility to access the components of the CORBA object, stored inside the Any.
DynAnyFactory Produces DynAnys from Anys or typecodes.
DynAnyFactoryOperations Defines the operations, applicable for DynAnyFactory.
DynAnyOperations Defines the operations, applicable to DynAny.
DynArray Represents a fixed size array.
DynArrayOperations Defines operations, applicable for DynArray.
DynEnum Defines the dynamic enumeration.
DynEnumOperations Defines operations, applicable to the dynamic enumeration.
DynFixed Defines dynamic any, holding CORBA fixed.
DynFixedOperations Defines operations, applicable for DynAny, holding CORBA fixed.
DynSequence Defines a dynamic resizeable array with the optional upper size bound.
DynSequenceOperations Defines operations, applicable to DynSequence.
DynStruct Defines a fixed size structure with the named fields that may have different types.
DynStructOperations Defines the operations, applicable to the DynStructure.
DynUnion Defines a fixed size structure with the named fields that may have different types.
DynUnionOperations Defines the operations, applicable to the DynUnion.
DynValue Defines a non boxed value type.
DynValueBox A "ValueBox" is a Value type container, holding a single instance of the other CORBA type.
DynValueBoxOperations Defines operations, applicable for the boxed value type.
DynValueCommon Defines DynAny that may hold CORBA null.
DynValueCommonOperations Provides operations, applicable to DynAnys that may hold CORBA null.
DynValueOperations Defines operations, applicable to DynValue.

Class Summary

AnySeqHelper A helper operations for the array of Any.
DynAnyFactoryHelper The helper operations for DynAnyFactory.
DynAnyHelper The helper operations for DynAny.
DynAnySeqHelper A helper operations for the array of DynAny (DynAny[]).
DynArrayHelper The helper operations for DynArray.
DynEnumHelper The helper operations for DynEnum.
DynFixedHelper The helper operations for DynFixed.
DynSequenceHelper The helper operations for DynSequence.
DynStructHelper The helper operations for DynStruct.
DynUnionHelper The helper operations for DynUnion.
DynValueHelper The helper operations for DynValue.
FieldNameHelper A helper for the FieldName.
NameDynAnyPair Stores the named value, representing the name by string and the value by DynAny.
NameDynAnyPairHelper A helper operations for the structure NameDynAnyPair.
NameDynAnyPairSeqHelper A helper operations for the array of NameDynAnyPair (NameDynAnyPair[]).
NameValuePair Holds the value, having the given name(id).
NameValuePairHelper A helper operations for the structure NameValuePair.
NameValuePairSeqHelper A helper operations for the array of NameValuePair.
_DynAnyFactoryStub Should provide support for remote invocation of methods on DynAnyFactory.
_DynAnyStub Should provide support for remote invocation of methods on DynAny.
_DynArrayStub Should provide support for remote invocation of methods on DynArray.
_DynEnumStub Should provide support for remote invocation of methods on DynEnum.
_DynFixedStub Should provide support for remote invocation of methods on DynFixed.
_DynSequenceStub Should provide support for remote invocation of methods on DynSequence.
_DynStructStub Should provide support for remote invocation of methods on DynStruct.
_DynUnionStub Should provide support for remote invocation of methods on DynUnion.
_DynValueStub Should provide support for remote invocation of methods on DynValue.
DynAny's allow to work with data structures, exact content of those is not known at the time of compilation. In this way, the conception of DynAny remebers the java reflection mechanism. DynAny usually obtain the value from the Any that, if needed, can carry highly nested data structures (like array of sequences of unions). DynAny's allow to see/modify all parts of such structures. This is especially helpful for writing generic servers (bridges, event channels supporting, filtering and so on). Similarly, DynAny's can create an Any at runtime, without having static knowledge of its type. This is helpful for writing generic clients like browsers, debuggers or user interface tools.

The API clearly states that DynAny and DynAnyFactory objects are local and cannot be transferred to remote server or client. While such methods are formally defined in the corresponding helpers, they simply always throw MARSHAL.

DynAny's are created by DynAnyFactory. The factory is obtaines by org.omg.CORBA.ORB.resolve_initial_references): ORB orb = ORB.init(new String[0], null); DynAnyFactory f = DynAnyFactoryHelper.narrow(orb.resolve_initial_references("DynAnyFactory")); DynAny's are also returned by some methods, invoked on another DynAny.

The primitive types like string or char are wrapped into an ordinary DynAny. It has multiple methods for setting/getting the content like {@link DynAnyOperations.get_string() or DynAnyOperations.insert_string(String). The more complex types like sequences or structures are wrapped into specialised DynAny's, providing means to access the enclosed members. In this case, the DynAny has the "internal cursor", normally pointing at one of the members in the data structure. The "internal cursor" can be set to the needed position DynAnyOperations.seek(int) or advanced forward (DynAnyOperations.next(). The member under cursor is returned by DynAnyOperations.current_component(). For composite DynAnys the methods like DynAnyOperations.get_string() or DynAnyOperations.insert_string(String) apply to the selected member, not to the complex DynAny in general.

DynAnys are created and optimized for traversing values extracted from anys or constructing values of anys at runtime. OMG does not recommend to use them for other purposes.