Previous Table of Contents Next


21.5.5 IORInfo Interface


   The IORInfo interface provides the server-side ORB service with access to the applicable policies during IOR construction and the ability to add components. The ORB passes an instance of its implementation of this interface as a parameter to IORInterceptor::establish_components.

   typedef string AdapterManagerId;

   typedef short AdapterState ; const AdapterState HOLDING = 0 ; const AdapterState ACTIVE = 1 ; const AdapterState DISCARDING = 2 ; const AdapterState INACTIVE = 3 ; const AdapterState NON_EXISTENT = 4 ;

   local interface IORInfo { CORBA::Policy get_effective_policy (in CORBA::PolicyType type); void add_ior_component

   (in IOP::TaggedComponent a_component);

   void add_ior_component_to_profile ( in IOP::TaggedComponent a_component, in IOP::ProfileId profile_id);

   readonly attribute AdapterManagerId manager_id;readonly attribute AdapterState state;readonly attribute ObjectReferenceTemplate adapter_template ;attribute ObjectReferenceFactory current_factory ;

   };

   All object adapter implementations provide some mechanism for creating object references. The construction of the object reference is influenced by all of the applicable server-side policies, which are used while assembling the tagged components required for the object reference. The IOR interceptors also influence the tagged components through the IORInfo::add_component and IORInfo:add_component_to_profile methods. After all of this construction has completed, the adapter conceptually has a template that can be used to create object references. We will refer to this template as the adapter template.

   For example, in the POA, after POA::create_POA method has completed, there is a complete template in the POA that will be used to create individual object references when create_reference or any other method is called that needs to create an object reference.

   21.5.5.1 get_effective_policy

   An ORB service implementation may determine what server side policy of a particular type is in effect for an IOR being constructed by calling the get_effective_policy operation. When the IOR being constructed is for an object implemented using a POA, all Policy objects passed to the PortableServer::POA::create_POA call that created that POA are accessible via get_effective_policy.

   If a policy for the given type is not known to the ORB, then this operation will raise INV_POLICY with a standard minor code of 3.

   .

Parameters

type

The CORBA::PolicyType specifying the type of policy to
return.

   Return Value The effective CORBA::Policy object of the requested type. If the given policy type is known, but no policy of that type is in effect, then this operation will return a nil object reference.

   21.5.5.2 add_ior_component

   A portable ORB service implementation calls add_ior_component from its implementation of establish_components to add a tagged component to the set that will be included when constructing IORs. The components in this set will be included in all profiles.

   Any number of components may exist with the same component ID.

   Parameters

   a_component The IOP::TaggedComponent to add.

   21.5.5.3 add_ior_component_to_profile

   A portable ORB service implementation calls add_ior_component_to_profile from its implementation of establish_components to add a tagged component to the set that will be included when constructing IORs. The components in this set will be included in the specified profile.

   Any number of components may exist with the same component ID.

   If the given profile ID does not define a known profile or it is impossible to add components to that profile, BAD_PARAM is raised with a standard minor code of 29.

Parameters Description
a_component The IOP::TaggedComponent to add.
profile_id The IOP::ProfileId of the profile to which this component will be added.

   21.5.5.4 manager_id

   The manager_id attribute provides an opaque handle to the manager of the adapter. This is used for reporting state changes in adapters managed by the same adapter manager.

   21.5.5.5 state

   The state attribute returns the current state of the adapter. This must be one of HOLDING, ACTIVE, DISCARDING, INACTIVE, NON_EXISTENT.

   21.5.5.6 adapter_template

   The adapter_template attribute provides a means to obtain an object reference template whenever an ior interceptor is invoked. There is no standard way to directly create an object reference template. The value of adapter_template is the template created for the adapter policies and IOR interceptor calls to add_component and add_component_to_profile. The value of the adapter_template attribute is never changed for the lifetime of the object adapter.

   21.5.5.7 current_factory

   The current_factory attribute provides access to the factory that will be used by the adapter to create object references. current_factory initially has the same value as the adapter_template attribute, but this can be changed by setting current_factory to another factory. All object references created by the object adapter must be created by calling the make_object method on current_factory.

   The value of the current_factory attribute that is used by the adapter can only be set during the call to the components_established method.

   21.5.5.8 Method Validity

   The following table defines the validity of each attribute or operation in IORInfo in the methods defined in the IORInterceptor:

   Table 21-3 IORInfo validity

establish_components

components_established

get_effective_policy yes yes
add_component yes no
add_component_to_profile yes no
read manager_id yes yes
read state yes yes
read adapter_template no yes
read current_factory no yes
write current_factory no yes

   If an illegal call is made to an attribute or operation in IORInfo, the BAD_INV_ORDER system exception is raised with a standard minor code value of

   14.