Previous Table of Contents Next


5.2.8 Life Cycle issues


   Value type instances are always local to their creating context. For example, in a given language mapping an instance of a value type is always created as a local “language? object with no POA semantics attached to it initially.

   When passed using a CORBA invocation, a copy of the value is made in the receiving context and that copy starts its life as a local programming language entity with no POA semantics attached to it.

   If a value type supports an ordinary interface type, its instances may also be passed by reference when the formal parameter type is an interface type (see Section 5.2.4, “Parameter Passing,? on page 5-4). In this case they behave like ordinary object implementations and must be associated with a POA policy and also be registered with the ORB (e.g., POA::activate_object() before they can be passed by reference. Not registering the value as a CORBA object and/or not associating an appropriate policy with it results in an exception when trying to use it as a remote object, the “normal? behavior. The exception raised shall be OBJECT_NOT_EXIST with standard minor code 1.

   5.2.8.1 Creation and Factories

   When an instance of a value type is received by the ORB, it must be unmarshaled and an appropriate factory for its actual type found in order for the new instance to be created. The type is encoded by the RepositoryID, which is passed over the wire as part of an invocation. The mapping between the type (as specified by the RepositoryID) and the factory is language specific. In certain languages it may be possible to specify default policies that are used to find the factory, without requiring that specific routines be called. In others the runtime and/or generated code may have to explicitly specify the mapping on a per type basis. In others a combination may be used. In any event the ORB implementation is responsible for maintaining this mapping See Section 5.4.3, “Language Specific Value Factory Requirements,? on page 5-9 for more details on the requirements for each language mapping. Value box types do not need or use factories.