Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

TAO_Root_POA Class Reference

#include <Root_POA.h>

Inheritance diagram for TAO_Root_POA:
Inheritance graph
[legend]
Collaboration diagram for TAO_Root_POA:
Collaboration graph
[legend]

List of all members.

Classes

struct  Key_To_Object_Params

Public Types

enum  { TAO_OBJECTKEY_PREFIX_SIZE = 4 }
typedef ACE_CString String

Public Member Functions

PortableServer::POA_ptr create_POA (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, const CORBA::PolicyList &policies)
PortableServer::POA_ptr find_POA (const char *adapter_name, CORBA::Boolean activate_it)
void destroy (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion)
PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value)
PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value)
PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value)
PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value)
PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value)
PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value)
PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value)
char * the_name (void)
PortableServer::POA_ptr the_parent (void)
PortableServer::POAList * the_children (void)
PortableServer::POAManager_ptr the_POAManager (void)
PortableServer::POAManagerFactory_ptr the_POAManagerFactory (void)
PortableInterceptor::AdapterName * adapter_name (void)
void save_ior_component (const IOP::TaggedComponent &component)
void save_ior_component_and_profile_id (const IOP::TaggedComponent &component, IOP::ProfileId profile_id)
PortableServer::AdapterActivator_ptr the_activator (void)
void the_activator (PortableServer::AdapterActivator_ptr adapter_activator)
PortableServer::ServantManager_ptr get_servant_manager (void)
void set_servant_manager (PortableServer::ServantManager_ptr imgr)
PortableServer::Servant get_servant (void)
void set_servant (PortableServer::Servant servant)
PortableServer::ObjectIdactivate_object (PortableServer::Servant p_servant)
void activate_object_with_id (const PortableServer::ObjectId &id, PortableServer::Servant p_servant)
void deactivate_object (const PortableServer::ObjectId &oid)
CORBA::Object_ptr create_reference (const char *intf)
CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, const char *intf)
PortableServer::ObjectIdservant_to_id (PortableServer::Servant p_servant)
PortableServer::ObjectIdservant_to_user_id (PortableServer::Servant p_servant)
CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant)
PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference)
PortableServer::ObjectIdreference_to_id (CORBA::Object_ptr reference)
PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid)
CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid)
CORBA::OctetSeq * id (void)
TAO_POA_Policy_Setpolicies (void)
 Accessor for POA policies.
CORBA::Policy_ptr get_policy (CORBA::PolicyType policy)
 Get the set policy of the given type.
virtual CORBA::PolicyList * client_exposed_policies (CORBA::Short object_priority)
 TAO_Root_POA (const String &name, PortableServer::POAManager_ptr poa_manager, const TAO_POA_Policy_Set &policies, TAO_Root_POA *parent, ACE_Lock &lock, TAO_SYNCH_MUTEX &thread_lock, TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter)
virtual ~TAO_Root_POA (void)
const
TAO_Object_Adapter::poa_name
folded_name (void) const
const
TAO_Object_Adapter::poa_name
system_name (void) const
TAO_ORB_Coreorb_core (void) const
 ORB Core for POA.
TAO::Portable_Server::Cached_Policies & cached_policies (void)
 obtain a reference to the cached_profiles
TAO_Network_Priority_Hooknetwork_priority_hook (void)
 obtain a handle to the network priority hooks
TAO::Portable_Server::Cached_Policies::PriorityModel priority_model (void) const
CORBA::Boolean cleanup_in_progress (void)
TAO_Object_Adapterobject_adapter (void)
ACE_Locklock (void)
TAO_Stubkey_to_stub (const TAO::ObjectKey &key, const char *type_id, CORBA::Short priority)
PortableInterceptor::AdapterState get_adapter_state (void)
 Accessor methods to POA state.
virtual void * thread_pool (void) const
virtual CORBA::Policyserver_protocol (void)
CORBA::ULong outstanding_requests (void) const
const ACE_CStringname (void) const
CORBA::Boolean waiting_destruction (void) const
CORBA::Object_ptr invoke_key_to_object (void)
CORBA::Boolean system_id (void)
CORBA::ULong waiting_servant_deactivation (void) const
TAO_POA_Managertao_poa_manager ()
 Return the POA Manager related to this POA.
bool is_poa_generated (CORBA::Object_ptr reference, PortableServer::ObjectId &system_id)
bool is_servant_activation_allowed (PortableServer::Servant servant, bool &wait_occurred_restart_call)
int rebind_using_user_id_and_system_id (PortableServer::Servant servant, const PortableServer::ObjectId &user_id, const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall)
CORBA::Boolean servant_has_remaining_activations (PortableServer::Servant servant)
bool allow_implicit_activation (void) const
bool allow_multiple_activations (void) const
int is_servant_active (PortableServer::Servant servant, bool &wait_occurred_restart_call)
void deactivate_object_i (const PortableServer::ObjectId &oid)
CORBA::Boolean is_persistent (void) const
CORBA::Short server_priority (void) const
bool has_system_id (void) const
PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id)
TAO_SERVANT_LOCATION servant_present (const PortableServer::ObjectId &system_id, PortableServer::Servant &servant)
PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl)
int find_servant_priority (const PortableServer::ObjectId &system_id, CORBA::Short &priority)
int unbind_using_user_id (const PortableServer::ObjectId &user_id)
void cleanup_servant (PortableServer::Servant servant, const PortableServer::ObjectId &user_id)
void post_invoke_servant_cleanup (const PortableServer::ObjectId &system_id, const TAO::Portable_Server::Servant_Upcall &servant_upcall)
bool validate_lifespan (CORBA::Boolean is_persistent, const TAO::Portable_Server::Temporary_Creation_Time &creation_time) const
PortableServer::ObjectIdactivate_object_i (PortableServer::Servant p_servant, CORBA::Short priority, bool &wait_occurred_restart_call)
CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, bool indirect)
PortableServer::ObjectIdservant_to_id_i (PortableServer::Servant servant)
TAO_SYNCH_CONDITION & servant_deactivation_condition (void)
int is_poa_generated_id (const PortableServer::ObjectId &id)
void check_state (void)
 Check the state of this POA.
int delete_child (const String &child)
PortableServer::Servant user_id_to_servant_i (const PortableServer::ObjectId &oid)
virtual CORBA::ORB_ptr _get_orb (void)
 Determine if we are of the type specified by the "logical_type_id".
virtual void poa_activated_hook ()
 Hook - The POA has been (or is being) activated.
virtual void poa_deactivated_hook ()
 Hook - The POA has been deactivated.
virtual void servant_activated_hook (PortableServer::Servant servant, const PortableServer::ObjectId &oid)
 Hook - A servant has been activated.
virtual void servant_deactivated_hook (PortableServer::Servant servant, const PortableServer::ObjectId &oid)
 Hook - A servant has been deactivated.
CORBA::Object_ptr invoke_key_to_object_helper_i (const char *repository_id, const PortableServer::ObjectId &id)

Static Public Member Functions

static char name_separator (void)
static CORBA::ULong name_separator_length (void)
static void check_for_valid_wait_for_completions (const TAO_ORB_Core &orb_core, CORBA::Boolean wait_for_completion)
static int parse_ir_object_key (const TAO::ObjectKey &object_key, PortableServer::ObjectId &user_id)
 Calls protected static method used when POACurrent is not appropriate.
static void ort_adapter_factory_name (const char *name)
static const char * ort_adapter_factory_name (void)
static void imr_client_adapter_name (const char *name)
 Sets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.
static const char * imr_client_adapter_name (void)
 Gets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.

Public Attributes

CORBA::ULong caller_key_to_object_
PortableServer::Servant servant_for_key_to_object_
Key_To_Object_Params key_to_object_params_

Static Public Attributes

static CORBA::Octet const objectkey_prefix [TAO_OBJECTKEY_PREFIX_SIZE]

Protected Types

typedef
ACE_Hash_Map_Manager_Ex
< ACE_CString, TAO_Root_POA
*, ACE_Hash< ACE_CString >
, ACE_Equal_To< ACE_CString >
, ACE_Null_Mutex
CHILDREN

Protected Member Functions

int enter (void)
int exit (void)
virtual TAO_Root_POAnew_POA (const String &name, PortableServer::POAManager_ptr poa_manager, const TAO_POA_Policy_Set &policies, TAO_Root_POA *parent, ACE_Lock &lock, TAO_SYNCH_MUTEX &thread_lock, TAO_ORB_Core &orb_core, TAO_Object_Adapter *object_adapter)
 Template method for creating new POA's of this type.
PortableServer::POA_ptr create_POA_i (const char *adapter_name, PortableServer::POAManager_ptr poa_manager, const CORBA::PolicyList &policies)
PortableServer::POA_ptr create_POA_i (const String &adapter_name, PortableServer::POAManager_ptr poa_manager, const TAO_POA_Policy_Set &policies)
TAO_Root_POAfind_POA_i (const ACE_CString &child_name, CORBA::Boolean activate_it)
void destroy_i (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion)
void complete_destruction_i (void)
PortableServer::POAList * the_children_i (void)
PortableInterceptor::AdapterName * adapter_name_i (void)
void adapter_state_changed (const TAO::ORT_Array &array_obj_ref_template, PortableInterceptor::AdapterState state)
void add_ior_component (TAO_MProfile &mprofile, const IOP::TaggedComponent &component)
 Add the given tagged component to all profiles.
void add_ior_component_to_profile (TAO_MProfile &mprofile, const IOP::TaggedComponent &component, IOP::ProfileId profile_id)
CORBA::Object_ptr key_to_object (const TAO::ObjectKey &key, const char *type_id, TAO_ServantBase *servant, CORBA::Boolean collocated, CORBA::Short priority, bool indirect)
virtual TAO_Stubkey_to_stub_i (const TAO::ObjectKey &key, const char *type_id, CORBA::Short priority)
 Like key_to_stub() but assume that the ORB is not shutting down.
TAO_Stubcreate_stub_object (const TAO::ObjectKey &object_key, const char *type_id, CORBA::PolicyList *policy_list, TAO_Acceptor_Filter *filter, TAO_Acceptor_Registry &acceptor_registry)
PortableServer::Servant get_servant_i (void)
void activate_object_with_id_i (const PortableServer::ObjectId &id, PortableServer::Servant p_servant, CORBA::Short priority, bool &wait_occurred_restart_call)
virtual void remove_from_parent_i (void)
void deactivate_all_objects_i (CORBA::Boolean etherealize_objects)
void deactivate_all_objects_i (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion)
void wait_for_completions (CORBA::Boolean wait_for_completion)
CORBA::Object_ptr create_reference_i (const char *intf, CORBA::Short priority)
CORBA::Object_ptr create_reference_with_id_i (const PortableServer::ObjectId &oid, const char *intf, CORBA::Short priority)
PortableServer::Servant reference_to_servant_i (CORBA::Object_ptr reference)
CORBA::Object_ptr servant_to_reference_i (PortableServer::Servant p_servant)
PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid)
void establish_components (void)
void components_established (PortableInterceptor::IORInfo_ptr info)
void set_folded_name (TAO_Root_POA *parent)
void set_id (TAO_Root_POA *parent)
TAO::ObjectKey * create_object_key (const PortableServer::ObjectId &id)
PortableInterceptor::ObjectReferenceTemplate * get_adapter_template (void)
 Accessor methods to ObjectReferenceTemplate.
PortableInterceptor::ObjectReferenceTemplate * get_adapter_template_i (void)
 Accessor methods to ObjectReferenceTemplate, non locked version.
PortableInterceptor::ObjectReferenceFactory * get_obj_ref_factory (void)
 Accessor methods to PortableInterceptor::ObjectReferenceFactory.
void set_obj_ref_factory (PortableInterceptor::ObjectReferenceFactory *current_factory)
 Set the object reference factory.
TAO_SERVANT_LOCATION locate_servant_i (const PortableServer::ObjectId &id, PortableServer::Servant &servant)
PortableServer::Servant locate_servant_i (const char *operation, const PortableServer::ObjectId &id, TAO::Portable_Server::Servant_Upcall &servant_upcall, TAO::Portable_Server::POA_Current_Impl &poa_current_impl, bool &wait_occurred_restart_call)
TAO::ORT_Adapter * ORT_adapter (void)
TAO::ORT_Adapter * ORT_adapter_i (void)
TAO::ORT_Adapter_Factory * ORT_adapter_factory (void)
CORBA::Boolean persistent (void)
virtual CORBA::Boolean root (void) const
virtual char root_key_type (void)
void outstanding_requests (CORBA::ULong new_outstanding_requests)
CORBA::ULong increment_outstanding_requests (void)
CORBA::ULong decrement_outstanding_requests (void)

Static Protected Member Functions

static int parse_key (const TAO::ObjectKey &key, TAO_Object_Adapter::poa_name &poa_system_name, PortableServer::ObjectId &system_id, CORBA::Boolean &is_root, CORBA::Boolean &is_persistent, CORBA::Boolean &is_system_id, TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time)
static char persistent_key_char (void)
static char transient_key_char (void)
static CORBA::ULong persistent_key_type_length (void)
static char system_id_key_char (void)
static char user_id_key_char (void)
static CORBA::ULong system_id_key_type_length (void)
static char root_key_char (void)
static char non_root_key_char (void)
static CORBA::ULong root_key_type_length (void)

Protected Attributes

String name_
TAO_POA_Managerpoa_manager_
 Reference to the POAManager that this poa assicuates with.
TAO_POAManager_Factorypoa_manager_factory_
 Reference to the POAManagerFactory that generate the POAManager.
IOP::TaggedComponentSeq tagged_component_
IOP::TaggedComponentSeq tagged_component_id_
ACE_Array_Base< IOP::ProfileId > profile_id_array_
TAO_POA_Policy_Set policies_
TAO_Object_Adapter::poa_name folded_name_
TAO_Object_Adapter::poa_name_var system_name_
CORBA::OctetSeq id_
TAO::ORT_Adapter * ort_adapter_
 Pointer to the object reference template adapter.
PortableInterceptor::AdapterState adapter_state_
 Adapter can be accepting, rejecting etc.
TAO::Portable_Server::Cached_Policies cached_policies_
TAO_Network_Priority_Hooknetwork_priority_hook_
TAO::Portable_Server::Active_Policy_Strategies active_policy_strategies_
PortableServer::AdapterActivator_var adapter_activator_
CHILDREN children_
ACE_Locklock_
TAO_ORB_Coreorb_core_
 Cached pointer of our ORB_Core.
TAO_Object_Adapterobject_adapter_
 The object adapter we belong to.
CORBA::Boolean cleanup_in_progress_
CORBA::ULong outstanding_requests_
TAO_SYNCH_CONDITION outstanding_requests_condition_
CORBA::Boolean wait_for_completion_pending_
CORBA::Boolean waiting_destruction_
TAO_SYNCH_CONDITION servant_deactivation_condition_
TAO_Acceptor_Filter_Factoryfilter_factory_

Friends

class TAO_Object_Adapter
class TAO::Portable_Server::Servant_Upcall
class TAO::Portable_Server::Non_Servant_Upcall
class TAO_POA_Manager
class TAO_RT_Collocation_Resolver
class TAO_IORInfo

Detailed Description

Implementation of the PortableServer::POA interface.

Definition at line 114 of file Root_POA.h.


Member Typedef Documentation

Definition at line 726 of file Root_POA.h.

Definition at line 127 of file Root_POA.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
TAO_OBJECTKEY_PREFIX_SIZE 

Definition at line 275 of file Root_POA.h.


Constructor & Destructor Documentation

TAO_Root_POA::TAO_Root_POA ( const String name,
PortableServer::POAManager_ptr  poa_manager,
const TAO_POA_Policy_Set policies,
TAO_Root_POA parent,
ACE_Lock lock,
TAO_SYNCH_MUTEX &  thread_lock,
TAO_ORB_Core orb_core,
TAO_Object_Adapter object_adapter 
)

Definition at line 186 of file Root_POA.cpp.

  : name_ (name),
    poa_manager_ (* (dynamic_cast <TAO_POA_Manager*> (poa_manager))),

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
    poa_manager_factory_ (* (object_adapter->poa_manager_factory_)),
#endif

    tagged_component_ (),
    tagged_component_id_ (),
    profile_id_array_ (0),
    policies_ (policies),
    ort_adapter_ (0),
    adapter_state_ (PortableInterceptor::HOLDING),
    network_priority_hook_ (0),
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
    adapter_activator_ (),
#endif /* TAO_HAS_MINIMUM_POA == 0 */
    children_ (),
    lock_ (lock),
    orb_core_ (orb_core),
    object_adapter_ (object_adapter),
    cleanup_in_progress_ (false),
    outstanding_requests_ (0),
    outstanding_requests_condition_ (thread_lock),
    wait_for_completion_pending_ (0),
    waiting_destruction_ (false),
    servant_deactivation_condition_ (thread_lock),
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
    filter_factory_ (0),
#endif
    caller_key_to_object_ (0),
    servant_for_key_to_object_ (0)
{
  // Since we are keeping a reference to a POAManager, we need to
  // increment the reference count but we do this safely.
  PortableServer::POAManager_var pm_guard (
    PortableServer::POAManager::_duplicate(&this->poa_manager_));

  // Parse the policies that are used in the critical path in
  // a cache.
  this->cached_policies_.update (this->policies_);

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
  this->filter_factory_
    = ACE_Dynamic_Service<TAO_Acceptor_Filter_Factory>::instance (
        "TAO_Acceptor_Filter_Factory");
#endif

  this->network_priority_hook_
    = ACE_Dynamic_Service<TAO_Network_Priority_Hook>::instance (
        "TAO_Network_Priority_Hook");

  if (this->network_priority_hook_ != 0)
    {
      this->network_priority_hook_->update_network_priority (
        *this, this->policies_);
    }

#if (TAO_HAS_MINIMUM_POA == 1)
  // If this is the RootPOA, set the value of the ImplicitActivationPolicy
  // to IMPLICIT_ACTIVATION since it is impossible to pass the policy
  // as it is not compiled into the library.
  //
  // If the ImplicitActivationPolicy policy is ever compiled in the
  // minimum POA builds, remove this code and remove the guards
  // in Object_Adapter.cpp when changing the default policy for the
  // RootPOA.
  if (ACE_OS::strcmp (this->name_.c_str (),
                      TAO_DEFAULT_ROOTPOA_NAME) == 0)
    {
      this->cached_policies_.implicit_activation
        (PortableServer::IMPLICIT_ACTIVATION);
    }
#endif /* TAO_HAS_MINIMUM_POA == 1 */

  // Set the active strategies to be used by this POA
  this->active_policy_strategies_.update (this->cached_policies_,
                                          this);
  TAO::Portable_Server::Active_Policy_Strategies_Cleanup_Guard aps_cleanup_guard (
    &this->active_policy_strategies_);

  // Set the folded name of this POA.
  this->set_folded_name (parent);

  // Register self with manager.
  int result = this->poa_manager_.register_poa (this);
  if (result != 0)
    {
      throw ::CORBA::OBJ_ADAPTER ();
    }

  // Add self to Object Adapter class.
  result =
    this->object_adapter ().bind_poa (this->folded_name_,
                                      this,
                                      this->system_name_.out ());
  if (result != 0)
    {
      // Remove from POA Manager in case of errors. No checks of
      // further errors...
      this->poa_manager_.remove_poa (this);

      throw ::CORBA::OBJ_ADAPTER ();
    }

  // Set the id for this POA.
  this->set_id (parent);

  // Notify the Lifespan strategy of our startup
  try
    {
      this->active_policy_strategies_.lifespan_strategy()->notify_startup ();
    }
  catch (const ::CORBA::Exception&)
    {
      this->poa_manager_.remove_poa (this);
      this->object_adapter ().unbind_poa (this,
                                          this->folded_name_,
                                          this->system_name_.in ());
      throw;
    }

  // Now when everything is fine we can release the quards.
  pm_guard._retn ();
  aps_cleanup_guard._retn ();
}

TAO_Root_POA::~TAO_Root_POA ( void   )  [virtual]

Definition at line 321 of file Root_POA.cpp.


Member Function Documentation

CORBA::ORB_ptr TAO_Root_POA::_get_orb ( void   )  [virtual]

Determine if we are of the type specified by the "logical_type_id".

Reimplemented from CORBA::LocalObject.

Definition at line 2659 of file Root_POA.cpp.

{
  return CORBA::ORB::_duplicate (this->orb_core_.orb ());
}

PortableServer::ObjectId * TAO_Root_POA::activate_object ( PortableServer::Servant  p_servant  ) 

Reimplemented in TAO_RT_POA.

Definition at line 1129 of file Root_POA.cpp.

{
  while (1)
    {
      bool wait_occurred_restart_call = false;

      // Lock access for the duration of this transaction.
      TAO_POA_GUARD_RETURN (0);

      PortableServer::ObjectId *result =
        this->activate_object_i (servant,
                                 this->server_priority (),
                                 wait_occurred_restart_call);

      // If we ended up waiting on a condition variable, the POA state
      // may have changed while we are waiting.  Therefore, we need to
      // restart this call.
      if (wait_occurred_restart_call)
        continue;
      else
        return result;
    }
}

PortableServer::ObjectId * TAO_Root_POA::activate_object_i ( PortableServer::Servant  p_servant,
CORBA::Short  priority,
bool &  wait_occurred_restart_call 
)

Definition at line 1118 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    activate_object (servant,
                     priority,
                     wait_occurred_restart_call);
}

void TAO_Root_POA::activate_object_with_id ( const PortableServer::ObjectId id,
PortableServer::Servant  p_servant 
)

Reimplemented in TAO_RT_POA.

Definition at line 1154 of file Root_POA.cpp.

{
  while (1)
    {
      bool wait_occurred_restart_call = false;

      // Lock access for the duration of this transaction.
      TAO_POA_GUARD;

      this->activate_object_with_id_i (id,
                                       servant,
                                       this->server_priority (),
                                       wait_occurred_restart_call);

      // If we ended up waiting on a condition variable, the POA state
      // may have changed while we are waiting.  Therefore, we need to
      // restart this call.
      if (wait_occurred_restart_call)
        continue;
      else
        return;
    }
}

void TAO_Root_POA::activate_object_with_id_i ( const PortableServer::ObjectId id,
PortableServer::Servant  p_servant,
CORBA::Short  priority,
bool &  wait_occurred_restart_call 
) [protected]

Definition at line 1180 of file Root_POA.cpp.

{
  this->active_policy_strategies_.servant_retention_strategy()->
    activate_object_with_id (id,
                             servant,
                             priority,
                             wait_occurred_restart_call);
}

PortableInterceptor::AdapterName * TAO_Root_POA::adapter_name ( void   ) 

This method returns the adapter_name as a sequence of strings of length one or more or just a fixed name depending on the Object Adapter. Added wrt to ORT Spec.

Definition at line 32 of file Root_POA.inl.

{
  return this->adapter_name_i ();
}

PortableInterceptor::AdapterName * TAO_Root_POA::adapter_name_i ( void   )  [protected]

This method returns the adapter_name as a sequence of strings of length one or more or just a fixed name depending on the Object Adapter. Added wrt to ORT Spec.

Definition at line 1003 of file Root_POA.cpp.

{
  // The adapter name is the sequence of names starting from the
  // RootPOA to the one whose name is requested.  The name of the
  // RootPOA is "RootPOA".

  PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);

  CORBA::ULong len = 0;

  // Find the length of the adapter name sequence by traversing the
  // POA hierarchy until the RootPOA is reached.  The RootPOA has no
  // parent.
  while (!CORBA::is_nil (poa.in ()))
    {
      poa = poa->the_parent ();
      ++len;
    }

  // Empty adapter name sequence.
  PortableInterceptor::AdapterName *names = 0;
  ACE_NEW_THROW_EX (names,
                    PortableInterceptor::AdapterName (len),
                    CORBA::NO_MEMORY (
                      CORBA::SystemException::_tao_minor_code (
                        TAO::VMCID,
                        ENOMEM),
                      CORBA::COMPLETED_NO));

  PortableInterceptor::AdapterName_var safe_names (names);

  names->length (len);

  poa = PortableServer::POA::_duplicate (this);

  (*names)[0] = CORBA::string_dup ("RootPOA");

  // Fill in the AdapterName sequence as the POA hierarchy is
  // traversed.
  CORBA::ULong ilen = len;
  for (CORBA::ULong i = 1; i < len; ++i)
    {
      (*names)[--ilen] = poa->the_name ();

      poa = poa->the_parent ();

      // If this condition asserts, the POA hierarchy was modified
      // (i.e. reduced in size) by another thread!
      ACE_ASSERT ((ilen > 0 ? !CORBA::is_nil (poa.in ()) : 1));
    }

  return safe_names._retn ();
}

void TAO_Root_POA::adapter_state_changed ( const TAO::ORT_Array array_obj_ref_template,
PortableInterceptor::AdapterState  state 
) [protected]

Method to notify the IOR Interceptors when there is a state changed not related to POAManager.

Definition at line 1104 of file Root_POA.cpp.

{
  TAO_IORInterceptor_Adapter *ior_adapter =
    this->orb_core_.ior_interceptor_adapter ();

  if (ior_adapter)
    {
      ior_adapter->adapter_state_changed (array_obj_ref_template, state);
    }
}

void TAO_Root_POA::add_ior_component ( TAO_MProfile mprofile,
const IOP::TaggedComponent &  component 
) [protected]

Add the given tagged component to all profiles.

Definition at line 1058 of file Root_POA.cpp.

{
  // Add the given tagged component to all profiles.
  const CORBA::ULong profile_count = mprofile.profile_count ();

  for (CORBA::ULong i = 0; i < profile_count; ++i)
    {
      TAO_Profile *profile = mprofile.get_profile (i);

      profile->add_tagged_component (component);
    }
}

void TAO_Root_POA::add_ior_component_to_profile ( TAO_MProfile mprofile,
const IOP::TaggedComponent &  component,
IOP::ProfileId  profile_id 
) [protected]

Add the given tagged component to all profiles matching the given ProfileId.

Definition at line 1073 of file Root_POA.cpp.

{
  // Add the given tagged component to all profiles matching the given
  // ProfileId.
  bool found_profile = false;

  CORBA::ULong const profile_count = mprofile.profile_count ();

  for (CORBA::ULong i = 0; i < profile_count; ++i)
    {
      TAO_Profile *profile = mprofile.get_profile (i);

      if (profile->tag () == profile_id)
        {
          profile->add_tagged_component (component);

          found_profile = true;
        }
    }

  // According to the Portable Interceptor specification, we're
  // supposed to throw a CORBA::BAD_PARAM exception if no profile
  // matched the given ProfileId.
  if (found_profile == false)
    throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 29, CORBA::COMPLETED_NO);
}

bool TAO_Root_POA::allow_implicit_activation ( void   )  const

Definition at line 2474 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.implicit_activation_strategy ()->
    allow_implicit_activation ();
}

bool TAO_Root_POA::allow_multiple_activations ( void   )  const

Definition at line 2481 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.id_uniqueness_strategy ()->
    allow_multiple_activations ();
}

TAO::Portable_Server::Cached_Policies & TAO_Root_POA::cached_policies ( void   ) 

obtain a reference to the cached_profiles

Definition at line 2512 of file Root_POA.cpp.

{
  return this->cached_policies_;
}

void TAO_Root_POA::check_for_valid_wait_for_completions ( const TAO_ORB_Core orb_core,
CORBA::Boolean  wait_for_completion 
) [static]

Definition at line 1220 of file Root_POA.cpp.

{
  if (wait_for_completion)
    {
      TAO::Portable_Server::POA_Current_Impl *poa_current_impl =
        static_cast <TAO::Portable_Server::POA_Current_Impl *>
                    (TAO_TSS_Resources::instance ()->poa_current_impl_);

      while (1)
        {
          // If wait_for_completion is TRUE and the current thread is
          // in an invocation context dispatched from some POA
          // belonging to the same ORB as this POA, the BAD_INV_ORDER
          // system exception with standard minor code 3 is raised and
          // POA destruction does not occur.
          if ((poa_current_impl != 0) && (poa_current_impl->poa () != 0))
            {
              if (&orb_core == &poa_current_impl->orb_core ())
                {
                  // CORBA 2.3 specifies which minor code corresponds
                  // to this particular problem.
                  throw ::CORBA::BAD_INV_ORDER (CORBA::OMGVMCID | 3,
                                                CORBA::COMPLETED_NO);
                }
            }
          else
            break;

          poa_current_impl =
            poa_current_impl->previous_current_impl_;
        }
    }
}

void TAO_Root_POA::check_state ( void   ) 

Check the state of this POA.

Definition at line 2621 of file Root_POA.cpp.

{
  this->active_policy_strategies_.lifespan_strategy ()->check_state ();
}

CORBA::Boolean TAO_Root_POA::cleanup_in_progress ( void   ) 

Definition at line 8 of file Root_POA.inl.

{
  return this->cleanup_in_progress_;
}

void TAO_Root_POA::cleanup_servant ( PortableServer::Servant  servant,
const PortableServer::ObjectId user_id 
)

Definition at line 1493 of file Root_POA.cpp.

{
  this->active_policy_strategies_.request_processing_strategy()->
    cleanup_servant (servant, user_id);
}

CORBA::PolicyList * TAO_Root_POA::client_exposed_policies ( CORBA::Short  object_priority  )  [virtual]

This method gives the policies that are exposed to the client. These policies are shipped within the IOR.

Reimplemented in TAO_RT_POA.

Definition at line 2238 of file Root_POA.cpp.

{
  CORBA::PolicyList *client_exposed_policies = 0;
  ACE_NEW_THROW_EX (client_exposed_policies,
                    CORBA::PolicyList (),
                    CORBA::NO_MEMORY (TAO::VMCID,
                                      CORBA::COMPLETED_NO));

  CORBA::PolicyList_var policies = client_exposed_policies;

  // Add in all of the client exposed policies.
  this->policies_.add_client_exposed_fixed_policies (client_exposed_policies);

  return policies._retn ();
}

void TAO_Root_POA::complete_destruction_i ( void   )  [protected]

Definition at line 327 of file Root_POA.cpp.

{
  bool doing_complete_destruction =
    this->waiting_destruction_ != false;

  // No longer awaiting destruction.
  this->waiting_destruction_ = false;

  PortableServer::POA_var poa;
  TAO::ORT_Array my_array_obj_ref_template;
  TAO::ORT_Adapter *ort_adapter = 0;
  if (doing_complete_destruction)
    {
      ort_adapter =
        this->ORT_adapter_i ();

      // In case no ORT library is linked we get zero.
      if (ort_adapter != 0)
        {
          // Get the ObjectReferenceTemplate.
          PortableInterceptor::ObjectReferenceTemplate * const ort =
            ort_adapter->get_adapter_template ();

          // Add it to the sequence of object reference templates, we
          // just notify for ourselves that we are now non_existent,
          // our childs will do it for themselves.
          my_array_obj_ref_template.size (1);
          my_array_obj_ref_template[0] = ort;
        }

      poa = PortableServer::POA::_duplicate (this);
    }

  // Remove POA from the POAManager.
  if (this->poa_manager_.remove_poa (this) != 0)
    throw ::CORBA::OBJ_ADAPTER ();

  // Remove POA from the Object Adapter.
  int result = this->object_adapter ().unbind_poa (this,
                                                   this->folded_name_,
                                                   this->system_name_.in ());
  if (result != 0)
    throw ::CORBA::OBJ_ADAPTER ();

  // Cleanup all strategies
  this->active_policy_strategies_.cleanup ();

  // Forced cleanup.  The new memory management scheme is evil and can
  // lead to reference deadlock, i.e., POA holds object A, but POA
  // cannot die because object A hold POA.
  {
    //
    // If new things are added to this cleanup code, make sure to move
    // the minimum CORBA #define after the declaration of
    // <non_servant_upcall>.
    //

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)

    // ATTENTION: Trick locking here, see class header for details
    TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
    ACE_UNUSED_ARG (non_servant_upcall);

    this->adapter_activator_ = PortableServer::AdapterActivator::_nil ();

#endif /* TAO_HAS_MINIMUM_POA == 0 */

  }

  ::CORBA::release (this);

  if (doing_complete_destruction)
    {
      this->adapter_state_ = PortableInterceptor::NON_EXISTENT;

      this->adapter_state_changed (my_array_obj_ref_template,
                                   this->adapter_state_);

      if (ort_adapter != 0)
        {
          ort_adapter->release (my_array_obj_ref_template[0]);

          TAO::ORT_Adapter_Factory *ort_factory =
            this->ORT_adapter_factory ();

          ort_factory->destroy (ort_adapter);

          this->ort_adapter_ = 0;
        }
    }
}

void TAO_Root_POA::components_established ( PortableInterceptor::IORInfo_ptr  info  )  [protected]

Call the IORInterceptor::components_established() method on all registered IORInterceptors.

Definition at line 2116 of file Root_POA.cpp.

{
  TAO_IORInterceptor_Adapter *ior_adapter =
    this->orb_core_.ior_interceptor_adapter ();

  if (ior_adapter)
    {
      ior_adapter->components_established (info);
    }
}

PortableServer::IdAssignmentPolicy_ptr TAO_Root_POA::create_id_assignment_policy ( PortableServer::IdAssignmentPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 125 of file Root_POA.cpp.

{
  TAO::Portable_Server::IdAssignmentPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::IdAssignmentPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

PortableServer::IdUniquenessPolicy_ptr TAO_Root_POA::create_id_uniqueness_policy ( PortableServer::IdUniquenessPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 112 of file Root_POA.cpp.

{
  TAO::Portable_Server::IdUniquenessPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::IdUniquenessPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

PortableServer::ImplicitActivationPolicy_ptr TAO_Root_POA::create_implicit_activation_policy ( PortableServer::ImplicitActivationPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 139 of file Root_POA.cpp.

{
  TAO::Portable_Server::ImplicitActivationPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::ImplicitActivationPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

PortableServer::LifespanPolicy_ptr TAO_Root_POA::create_lifespan_policy ( PortableServer::LifespanPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 98 of file Root_POA.cpp.

{
  TAO::Portable_Server::LifespanPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::LifespanPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

TAO::ObjectKey * TAO_Root_POA::create_object_key ( const PortableServer::ObjectId id  )  [protected]

Definition at line 1705 of file Root_POA.cpp.

{
  // Calculate the space required for the key.
  CORBA::ULong buffer_size =
    this->id_.length () +
    id.length ();

  // Create the buffer for the key.
  CORBA::Octet *buffer = TAO::ObjectKey::allocbuf (buffer_size);

  // First copy the POA id into the key.
  ACE_OS::memcpy (&buffer[0],
                  this->id_.get_buffer (),
                  this->id_.length ());

  // Then copy the object id into the key.
  ACE_OS::memcpy (&buffer[this->id_.length ()],
                  id.get_buffer (),
                  id.length ());

  // Create the key, giving the ownership of the buffer to the
  // sequence.
  TAO::ObjectKey *key = 0;
  ACE_NEW_RETURN (key,
                  TAO::ObjectKey (buffer_size,
                                  buffer_size,
                                  buffer,
                                  1),
                  0);

  return key;
}

PortableServer::POA_ptr TAO_Root_POA::create_POA ( const char *  adapter_name,
PortableServer::POAManager_ptr  poa_manager,
const CORBA::PolicyList &  policies 
)

Reimplemented in TAO_RT_POA.

Definition at line 695 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->create_POA_i (adapter_name, poa_manager, policies);
}

PortableServer::POA_ptr TAO_Root_POA::create_POA_i ( const char *  adapter_name,
PortableServer::POAManager_ptr  poa_manager,
const CORBA::PolicyList &  policies 
) [protected]

Definition at line 421 of file Root_POA.cpp.

{
  // Initialize a TAO_POA_Policy_Set instance so that it contains the
  // default POA policies.
  TAO_POA_Policy_Set tao_policies (this->object_adapter ().default_poa_policies ());

  // Merge policies from the ORB level.
  this->object_adapter ().validator ().merge_policies (tao_policies.policies ());

  // Merge in any policies that the user may have specified.
  tao_policies.merge_policies (policies);

  // If any of the policy objects specified are not valid for the ORB
  // implementation, if conflicting policy objects are specified, or
  // if any of the specified policy objects require prior
  // administrative action that has not been performed, an
  // InvalidPolicy exception is raised containing the index in the
  // policies parameter value of the first offending policy object.
  tao_policies.validate_policies (this->object_adapter ().validator (),
                                  this->orb_core_);

  // If the poa_manager parameter is null, a new POAManager object is
  // created and associated with the new POA. Otherwise, the specified
  // POAManager object is associated with the new POA. The POAManager
  // object can be obtained using the attribute name the_POAManager.

  PortableServer::POAManager_var the_poa_manager;

  if (CORBA::is_nil (poa_manager))
    {
#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)

      PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);
      PortableServer::POA_var root_poa;

      // Find the RootPOA by traversing the POA hierarchy until the
      // RootPOA is reached.  The RootPOA has no parent.
      while (!CORBA::is_nil (poa.in ()))
      {
        root_poa = poa;
        poa = poa->the_parent ();
      }

      // Get the POAManagerFactory instance owned by RootPOA.
      PortableServer::POAManagerFactory_var tao_poa_manager_factory
        = root_poa->the_POAManagerFactory ();

      CORBA::PolicyList empty_policies;

      // The POAManager name will be generated when the POAManager instance
      // is created.
      the_poa_manager
        = tao_poa_manager_factory->create_POAManager (0, empty_policies);
#else

      PortableServer::POAManager_ptr the_poa_manager_ptr;
      ACE_NEW_THROW_EX (the_poa_manager_ptr,
                        TAO_POA_Manager (this->object_adapter (), 0),
                        CORBA::NO_MEMORY ());
      the_poa_manager = the_poa_manager_ptr;
#endif /* TAO_HAS_MINIMUM_POA == 0 && ! CORBA_E_COMPACT) */

    }
  else
    {
      the_poa_manager = PortableServer::POAManager::_duplicate (poa_manager);
    }

  PortableServer::POA_var poa = this->create_POA_i (adapter_name,
                                                    the_poa_manager.in (),
                                                    tao_policies);

  return poa._retn ();
}

PortableServer::POA_ptr TAO_Root_POA::create_POA_i ( const String adapter_name,
PortableServer::POAManager_ptr  poa_manager,
const TAO_POA_Policy_Set policies 
) [protected]

Definition at line 527 of file Root_POA.cpp.

{
  // This operaton creates a new POA as a child of the target POA. The
  // specified name identifies the new POA with respect to other POAs
  // with the same parent POA. If the target POA already has a child
  // POA with the specified name, the AdapterAlreadyExists exception
  // is raised.
  // Child was found
  if (this->children_.find (adapter_name) != -1)
    {
      throw PortableServer::POA::AdapterAlreadyExists ();
    }

  //
  // Child was not found.  Create one.
  //

  // The specified policy objects are associated with the POA and used
  // to control its behavior. The policy objects are effectively
  // copied before this operation returns, so the application is free
  // to destroy them while the POA is in use. Policies are not
  // inherited from the parent POA.
  TAO_Root_POA * poa = this->new_POA (adapter_name,
                                      poa_manager,
                                      policies,
                                      this,
                                      this->object_adapter ().lock (),
                                      this->object_adapter ().thread_lock (),
                                      this->orb_core_,
                                      this->object_adapter_);

  // Give ownership of the new map to the POA_var.  Note, that it
  // is important for the POA_var to take ownership before
  // checking for exception since we may need to delete the new map.
  PortableServer::POA_var new_poa = poa;

  // Check for exception in construction of the POA.

  // Add to children map
  if (this->children_.bind (adapter_name, poa) != 0)
    {
      throw ::CORBA::OBJ_ADAPTER ();
    }

  // Increment the reference count on the child POA since the children
  // map must retain ownership.  Do so immediately before any other
  // operations to prevent memory cleanup problems induced from
  // errors below.
  poa->_add_ref ();

  // Iterate over the registered IOR interceptors so that they may be
  // given the opportunity to add tagged components to the profiles
  // for this servant.
  poa->establish_components ();

  // Note: Creating a POA using a POA manager that is in the active
  // state can lead to race conditions if the POA supports preexisting
  // objects, because the new POA may receive a request before its
  // adapter activator, servant manager, or default servant have been
  // initialized. These problems do not occur if the POA is created by
  // an adapter activator registered with a parent of the new POA,
  // because requests are queued until the adapter activator
  // returns. To avoid these problems when a POA must be explicitly
  // initialized, the application can initialize the POA by invoking
  // find_POA with a TRUE activate parameter.

  // Everything is fine. Don't let the POA_var release the
  // implementation.
  return new_poa._retn ();
}

CORBA::Object_ptr TAO_Root_POA::create_reference ( const char *  intf  ) 

Reimplemented in TAO_RT_POA.

Definition at line 1288 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (CORBA::Object::_nil ());

  return this->create_reference_i (intf,
                                   this->server_priority ());
}

CORBA::Object_ptr TAO_Root_POA::create_reference_i ( const char *  intf,
CORBA::Short  priority 
) [protected]

Definition at line 1298 of file Root_POA.cpp.

{
  if (!this->has_system_id ())
    {
      throw PortableServer::POA::WrongPolicy ();
    }

  return this->active_policy_strategies_.servant_retention_strategy()->
    create_reference (intf, priority);
}

CORBA::Object_ptr TAO_Root_POA::create_reference_with_id ( const PortableServer::ObjectId oid,
const char *  intf 
)

Reimplemented in TAO_RT_POA.

Definition at line 772 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (CORBA::Object::_nil ());

  return this->create_reference_with_id_i (id,
                                           intf,
                                           this->server_priority ());
}

CORBA::Object_ptr TAO_Root_POA::create_reference_with_id_i ( const PortableServer::ObjectId oid,
const char *  intf,
CORBA::Short  priority 
) [protected]

Definition at line 1332 of file Root_POA.cpp.

{
  // If the POA has the SYSTEM_ID policy and it detects that the
  // Object Id value was not generated by the system or for this POA,
  // the create_reference_with_id operation may raise the BAD_PARAM
  // system exception. An ORB is not required to detect all such
  // invalid Object Id values, but a portable application must not
  // invoke this operation on a POA that has the SYSTEM_ID policy with
  // an Object Id value that was not previously generated by the
  // system for that POA, or, if the POA also has the PERSISTENT
  // policy, for a previous instantiation of the same POA.
  if (this->has_system_id () &&
      !this->is_poa_generated_id (user_id))
    {
      throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 14, CORBA::COMPLETED_NO);
    }

  return this->active_policy_strategies_.servant_retention_strategy()->
    create_reference_with_id (user_id, intf, priority);
}

PortableServer::RequestProcessingPolicy_ptr TAO_Root_POA::create_request_processing_policy ( PortableServer::RequestProcessingPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 161 of file Root_POA.cpp.

{
  TAO::Portable_Server::RequestProcessingPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::RequestProcessingPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

PortableServer::ServantRetentionPolicy_ptr TAO_Root_POA::create_servant_retention_policy ( PortableServer::ServantRetentionPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 150 of file Root_POA.cpp.

{
  TAO::Portable_Server::ServantRetentionPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::ServantRetentionPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

TAO_Stub * TAO_Root_POA::create_stub_object ( const TAO::ObjectKey &  object_key,
const char *  type_id,
CORBA::PolicyList *  policy_list,
TAO_Acceptor_Filter filter,
TAO_Acceptor_Registry acceptor_registry 
) [protected]

Definition at line 2159 of file Root_POA.cpp.

{
  bool error = false;

  // Count the number of endpoints.
  size_t const profile_count = acceptor_registry.endpoint_count ();

  // Create a profile container and have acceptor registries populate
  // it with profiles as appropriate.
  TAO_MProfile mprofile (0);

  // Allocate space for storing the profiles.  There can never be more
  // profiles than there are endpoints.  In some cases, there can be
  // less profiles than endpoints.
  int result = mprofile.set (static_cast <CORBA::ULong> (profile_count));
  if (result == -1)
    error = true;

  if (!error)
    {
      result =
        filter->fill_profile (object_key,
                              mprofile,
                              acceptor_registry.begin (),
                              acceptor_registry.end ());
      if (result == -1)
        error = true;
    }

  if (!error)
    result = filter->encode_endpoints (mprofile);

  if (result == -1)
    error = true;

  if (error)
    throw ::CORBA::INTERNAL (
      CORBA::SystemException::_tao_minor_code (
        TAO_MPROFILE_CREATION_ERROR,
        0),
      CORBA::COMPLETED_NO);

  // Make sure we have at least one profile.  <mp> may end up being
  // empty if none of the acceptor endpoints have the right priority
  // for this object, for example.
  if (mprofile.profile_count () == 0)
    throw ::CORBA::BAD_PARAM (
      CORBA::SystemException::_tao_minor_code (
        TAO_MPROFILE_CREATION_ERROR,
        0),
      CORBA::COMPLETED_NO);

  TAO_Stub *stub =
    this->orb_core_.create_stub_object (mprofile, type_id, policy_list);

  // Add the saved tagged components methods to the profiles.
  CORBA::ULong len = this->tagged_component_.length ();
  for (CORBA::ULong i = 0; i != len; ++i)
    {
      this->add_ior_component (mprofile, this->tagged_component_[i]);
    }

  len = this->tagged_component_id_.length ();

  for (CORBA::ULong k = 0; k != len; ++k)
    {
      this->add_ior_component_to_profile (mprofile,
                                          this->tagged_component_id_[k],
                                          this->profile_id_array_[k]);
    }

  return stub;
}

PortableServer::ThreadPolicy_ptr TAO_Root_POA::create_thread_policy ( PortableServer::ThreadPolicyValue  value  ) 

Reimplemented in TAO_RT_POA.

Definition at line 83 of file Root_POA.cpp.

{
  TAO::Portable_Server::ThreadPolicy *policy = 0;
  ACE_NEW_THROW_EX (policy,
                    TAO::Portable_Server::ThreadPolicy (value),
                    CORBA::NO_MEMORY ());

  return policy;
}

void TAO_Root_POA::deactivate_all_objects_i ( CORBA::Boolean  etherealize_objects  )  [protected]

Definition at line 1256 of file Root_POA.cpp.

{
  this->active_policy_strategies_.request_processing_strategy ()->
    etherealize_objects (etherealize_objects);

  this->active_policy_strategies_.servant_retention_strategy ()->
    deactivate_all_objects ();
}

void TAO_Root_POA::deactivate_all_objects_i ( CORBA::Boolean  etherealize_objects,
CORBA::Boolean  wait_for_completion 
) [protected]

Definition at line 1193 of file Root_POA.cpp.

{
  this->deactivate_all_objects_i (etherealize_objects);

  this->wait_for_completions (wait_for_completion);
}

void TAO_Root_POA::deactivate_object ( const PortableServer::ObjectId oid  ) 

Reimplemented in TAO_RT_POA.

Definition at line 1266 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD;

  this->deactivate_object_i (oid);
}

void TAO_Root_POA::deactivate_object_i ( const PortableServer::ObjectId oid  ) 

Definition at line 1275 of file Root_POA.cpp.

{
  this->active_policy_strategies_.servant_retention_strategy()->
    deactivate_object (id);
}

CORBA::ULong TAO_Root_POA::decrement_outstanding_requests ( void   )  [protected]

Definition at line 201 of file Root_POA.inl.

{
  return --this->outstanding_requests_;
}

int TAO_Root_POA::delete_child ( const String child  ) 

Definition at line 962 of file Root_POA.cpp.

{
  int result = 0;

  // If we are not closing down, we must remove this child from our
  // collection.
  if (!this->cleanup_in_progress_)
    result = this->children_.unbind (child);

  // Otherwise, if we are closing down, we are currently iterating
  // over our children and there is not need to remove this child from
  // our collection.

  return result;
}

void TAO_Root_POA::destroy ( CORBA::Boolean  etherealize_objects,
CORBA::Boolean  wait_for_completion 
)

Reimplemented in TAO_RT_POA.

Definition at line 785 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO::Portable_Server::POA_Guard poa_guard (*this , 0);
  ACE_UNUSED_ARG (poa_guard);

  this->destroy_i (etherealize_objects, wait_for_completion);
}

void TAO_Root_POA::destroy_i ( CORBA::Boolean  etherealize_objects,
CORBA::Boolean  wait_for_completion 
) [protected]

Definition at line 802 of file Root_POA.cpp.

{
  if (this->cleanup_in_progress_)
    return;

  // Is the <wait_for_completion> semantics for this thread correct?
  TAO_Root_POA::check_for_valid_wait_for_completions (this->orb_core (),
                                                      wait_for_completion);

  this->cleanup_in_progress_ = true;

  // Inform the custom servant dispatching strategy to stop the working
  // threads when the poa is destroyed.
  this->poa_deactivated_hook ();

  // This operation destroys the POA and all descendant POAs. The POA
  // so destroyed (that is, the POA with its name) may be re-created
  // later in the same process. (This differs from the
  // POAManager::deactivate operation that does not allow a
  // re-creation of its associated POA in the same process.)

  // Remove POA from the parent
  this->remove_from_parent_i ();

  TAO::ORT_Array array_obj_ref_template (1);

  CORBA::ULong i = 0;

  // Gather all ObjectReferenceTemplates and change all adapter states
  // to INACTIVE.
  for (CHILDREN::iterator iterator = this->children_.begin ();
       iterator != this->children_.end ();
       ++iterator)
    {
      TAO_Root_POA * const child_poa = (*iterator).int_id_;

      TAO::ORT_Adapter * const adapter = child_poa->ORT_adapter_i ();

      // In case no ORT library is linked we get zero.
      if (adapter != 0)
        {
          // Get the ObjectReferenceTemplate for the child POA.
          PortableInterceptor::ObjectReferenceTemplate * const ort =
            adapter->get_adapter_template ();

          // Add it to the sequence of object reference templates that
          // will be destroyed.
          array_obj_ref_template.size (1);

          array_obj_ref_template[0] = ort;
        }

      child_poa->adapter_state_ =
        PortableInterceptor::INACTIVE;

      // Notify the state changes to the IORInterceptors
      this->adapter_state_changed (array_obj_ref_template,
                                   PortableInterceptor::INACTIVE);

      if (adapter != 0)
        adapter->release (array_obj_ref_template[0]);

      ++i;
    }

  // Destroy all child POA's now.
  for (CHILDREN::iterator destroy_iterator = this->children_.begin ();
       destroy_iterator != this->children_.end ();
       ++destroy_iterator)
    {
      TAO_Root_POA *destroy_child_poa = (*destroy_iterator).int_id_;

      destroy_child_poa->destroy_i (etherealize_objects,
                                    wait_for_completion);
    }

  // Notify the lifespan strategy of our shutdown
  this->active_policy_strategies_.lifespan_strategy()->notify_shutdown ();

// @todo, is the exception handling above correct, should we just fail when
// the notify above fails

  // When a POA is destroyed, any requests that have started execution
  // continue to completion. Any requests that have not started
  // execution are processed as if they were newly arrived, that is,
  // the POA will attempt to cause recreation of the POA by invoking
  // one or more adapter activators as described in Section 3.3.3.
  // If the wait_for_completion parameter is TRUE, the destroy
  // operation will return only after all requests in process have
  // completed and all invocations of etherealize have
  // completed. Otherwise, the destroy operation returns after
  // destroying the POAs.

  this->deactivate_all_objects_i (etherealize_objects,
                                  wait_for_completion);

  // If there are no outstanding requests and that we are not in a
  // non-servant upcall or if we are in a non-servant upcall, make
  // sure we are the POA related to the non-servant upcall.
  TAO::Portable_Server::Non_Servant_Upcall *non_servant_upcall_in_progress =
    this->object_adapter ().non_servant_upcall_in_progress ();
  if (this->outstanding_requests_ == 0 &&
      (non_servant_upcall_in_progress == 0 ||
       &non_servant_upcall_in_progress->poa () != this))
    {
      TAO::ORT_Array my_array_obj_ref_template;

      TAO::ORT_Adapter * const ort_adapter =
        this->ORT_adapter_i ();

      // In case no ORT library is linked we get zero.
      if (ort_adapter != 0)
        {
          // Get the ObjectReferenceTemplate.
          PortableInterceptor::ObjectReferenceTemplate * const ort =
            ort_adapter->get_adapter_template ();

          // Add it to the sequence of object reference templates, we
          // just notify for ourselves that we are now non_existent,
          // our childs will do it for themselves.
          my_array_obj_ref_template.size (1);
          my_array_obj_ref_template[0] = ort;
        }

      // According to the ORT spec, after a POA is destroyed, its state
      // has to be changed to NON_EXISTENT and all the registered
      // interceptors are to be informed. Since, the POA is destroyed
      // and is released in the complete_destruction_i method, we are
      // trying to keep the poa still around by doing a duplicate of
      // it. (a hack).
      PortableServer::POA_var poa = PortableServer::POA::_duplicate (this);

      this->complete_destruction_i ();

      this->adapter_state_ = PortableInterceptor::NON_EXISTENT;

      this->adapter_state_changed (my_array_obj_ref_template,
                                   this->adapter_state_);

      if (ort_adapter != 0)
        {
          ort_adapter->release (my_array_obj_ref_template[0]);

          TAO::ORT_Adapter_Factory *ort_factory =
            this->ORT_adapter_factory ();

          ort_factory->destroy (ort_adapter);

          this->ort_adapter_ = 0;
        }
    }
  else
    {
      // Mark that we are ready for destruction.
      this->waiting_destruction_ = true;
    }
}

int TAO_Root_POA::enter ( void   )  [protected]

Definition at line 2531 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.thread_strategy ()->enter();
}

void TAO_Root_POA::establish_components ( void   )  [protected]

Call the IORInterceptor::establish_components() method on all registered IORInterceptors. This method calls IORInterceptor::establish_components() method on all registered IORInterceptors, and IORInterceptor::components_established() once the former is completed.

Definition at line 2104 of file Root_POA.cpp.

{
  TAO_IORInterceptor_Adapter *ior_adapter =
    this->orb_core_.ior_interceptor_adapter ();

  if (ior_adapter)
    {
      ior_adapter->establish_components (this);
    }
}

int TAO_Root_POA::exit ( void   )  [protected]

Definition at line 2539 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.thread_strategy ()->exit();
}

PortableServer::POA_ptr TAO_Root_POA::find_POA ( const char *  adapter_name,
CORBA::Boolean  activate_it 
)

Reimplemented in TAO_RT_POA.

Definition at line 603 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  TAO_Root_POA *poa = this->find_POA_i (adapter_name, activate_it);

  return PortableServer::POA::_duplicate (poa);
}

TAO_Root_POA * TAO_Root_POA::find_POA_i ( const ACE_CString child_name,
CORBA::Boolean  activate_it 
) [protected]

Definition at line 617 of file Root_POA.cpp.

{
  TAO_Root_POA *child = 0;
  int result = this->children_.find (child_name, child);

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT)

  if (result != 0)
    {
      if (activate_it)
        {
          if (!CORBA::is_nil (this->adapter_activator_.in ()))
            {
              // Check our state
              this->check_state ();

              CORBA::Boolean success = false;

              {
                // ATTENTION: Trick locking here, see class header for details
                TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (
                  *this);
                ACE_UNUSED_ARG (non_servant_upcall);

                // When unknown_adapter gives a system exception, the POA
                // should just pass the system exception through
                // See 15.3.9.2 of the 3.1 CORBA spec
                success =
                  this->adapter_activator_->unknown_adapter (
                    this,
                    child_name.c_str ());
              }

              if (success)
                {
                  result = this->children_.find (child_name,
                                                 child);
                }
              else
                {
                  result = -1;
                }
            }
          else
            {
              result = -1;
            }
        }
      else
        {
          result = -1;
        }
    }
#else
  ACE_UNUSED_ARG (activate_it);
#endif /* TAO_HAS_MINIMUM_POA == 0 */

  if (result == 0)
    {
      return child;
    }
  else
    {
      // Otherwise, the AdapterNonExistent exception is raised.
      throw PortableServer::POA::AdapterNonExistent ();
    }
}

PortableServer::Servant TAO_Root_POA::find_servant ( const PortableServer::ObjectId system_id  ) 

Definition at line 1479 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    find_servant (system_id);
}

PortableServer::Servant TAO_Root_POA::find_servant ( const PortableServer::ObjectId system_id,
TAO::Portable_Server::Servant_Upcall &  servant_upcall,
TAO::Portable_Server::POA_Current_Impl &  poa_current_impl 
)

Definition at line 2271 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
          find_servant (system_id,
                        servant_upcall,
                        poa_current_impl);
}

int TAO_Root_POA::find_servant_priority ( const PortableServer::ObjectId system_id,
CORBA::Short priority 
)

Find the the servant with ObjectId <system_id>, and retrieve its priority. Usually used in RT CORBA with SERVER_DECLARED priority model.

Returns:
-1 if servant does not exist, else 0 indicating the servant exists and priority successfully retrieved.

Definition at line 2283 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
          find_servant_priority (system_id, priority);
}

const TAO_Object_Adapter::poa_name & TAO_Root_POA::folded_name ( void   )  const

Definition at line 99 of file Root_POA.inl.

{
  return this->folded_name_;
}

PortableInterceptor::AdapterState TAO_Root_POA::get_adapter_state ( void   ) 

Accessor methods to POA state.

The POA can be in one of HOLDING, ACTIVE, DISCARDING, INACTIVE and NON_EXISTENT states.

Definition at line 219 of file Root_POA.inl.

{
  return this->adapter_state_;
}

PortableInterceptor::ObjectReferenceTemplate * TAO_Root_POA::get_adapter_template ( void   )  [protected]

Accessor methods to ObjectReferenceTemplate.

Definition at line 38 of file Root_POA.inl.

{
  TAO::ORT_Adapter *adapter = this->ORT_adapter ();

  if (adapter)
    {
      return this->ort_adapter_->get_adapter_template();
    }

  return 0;
}

PortableInterceptor::ObjectReferenceTemplate * TAO_Root_POA::get_adapter_template_i ( void   )  [protected]

Accessor methods to ObjectReferenceTemplate, non locked version.

Definition at line 51 of file Root_POA.inl.

{
  if (this->ORT_adapter_i ())
    {
      return this->ort_adapter_->get_adapter_template ();
    }

  return 0;
}

PortableInterceptor::ObjectReferenceFactory * TAO_Root_POA::get_obj_ref_factory ( void   )  [protected]

Accessor methods to PortableInterceptor::ObjectReferenceFactory.

Definition at line 62 of file Root_POA.inl.

{
  TAO::ORT_Adapter *adapter = this->ORT_adapter ();

  if (adapter)
    {
      return this->ort_adapter_->get_obj_ref_factory();
    }

  return 0;
}

CORBA::Policy_ptr TAO_Root_POA::get_policy ( CORBA::PolicyType  policy  ) 

Get the set policy of the given type.

Definition at line 2615 of file Root_POA.cpp.

{
  return this->policies_.get_policy (policy);
}

PortableServer::Servant TAO_Root_POA::get_servant ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 2393 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  PortableServer::Servant servant = this->get_servant_i ();

  if (servant != 0)
    {
      // ATTENTION: Trick locking here, see class header for details
      TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
      ACE_UNUSED_ARG (non_servant_upcall);

      // The POA invokes _add_ref once on the Servant before returning
      // it. If the application uses reference counting, the caller of
      // get_servant is responsible for invoking _remove_ref once on
      // the returned Servant when it is finished with it. A
      // conforming caller need not invoke _remove_ref on the returned
      // Servant if the type of the Servant uses the default reference
      // counting inherited from ServantBase.
      servant->_add_ref ();

      return servant;
    }
  else
    {
      // If no servant has been associated with the POA, the NoServant
      // exception is raised.
      throw PortableServer::POA::NoServant ();
    }
}

PortableServer::Servant TAO_Root_POA::get_servant_i ( void   )  [protected]

Definition at line 2386 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.request_processing_strategy()->
    get_servant ();
}

PortableServer::ServantManager_ptr TAO_Root_POA::get_servant_manager ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 2366 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (PortableServer::ServantManager::_nil ());

  return this->active_policy_strategies_.request_processing_strategy()->
    get_servant_manager ();
}

bool TAO_Root_POA::has_system_id ( void   )  const

Definition at line 2446 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.id_assignment_strategy ()->
    has_system_id ();
}

CORBA::OctetSeq * TAO_Root_POA::id ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 1544 of file Root_POA.cpp.

{
  CORBA::OctetSeq *id = 0;
  ACE_NEW_THROW_EX (id,
                    CORBA::OctetSeq (this->id_),
                    CORBA::NO_MEMORY ());

  return id;
}

CORBA::Object_ptr TAO_Root_POA::id_to_reference ( const PortableServer::ObjectId oid  ) 

Reimplemented in TAO_RT_POA.

Definition at line 761 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->id_to_reference_i (oid, true);
}

CORBA::Object_ptr TAO_Root_POA::id_to_reference_i ( const PortableServer::ObjectId oid,
bool  indirect 
)

Definition at line 1536 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    id_to_reference (id, indirect);
}

PortableServer::Servant TAO_Root_POA::id_to_servant ( const PortableServer::ObjectId oid  ) 

Reimplemented in TAO_RT_POA.

Definition at line 752 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->id_to_servant_i (oid);
}

PortableServer::Servant TAO_Root_POA::id_to_servant_i ( const PortableServer::ObjectId oid  )  [protected]

Definition at line 1502 of file Root_POA.cpp.

{

  PortableServer::Servant servant =
    this->active_policy_strategies_.request_processing_strategy()->
      id_to_servant (id);

  if (servant != 0)
    {
      // ATTENTION: Trick locking here, see class header for details
      TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
      ACE_UNUSED_ARG (non_servant_upcall);

      // The POA invokes _add_ref once on the Servant before returning
      // it. If the application uses reference counting, the caller of
      // id_to_servant is responsible for invoking _remove_ref once on
      // the returned Servant when it is finished with it. A
      // conforming caller need not invoke _remove_ref on the returned
      // Servant if the type of the Servant uses the default reference
      // counting inherited from ServantBase.
      servant->_add_ref ();
    }

  return servant;
}

const char * TAO_Root_POA::imr_client_adapter_name ( void   )  [static]
void TAO_Root_POA::imr_client_adapter_name ( const char *  name  )  [static]
CORBA::ULong TAO_Root_POA::increment_outstanding_requests ( void   )  [protected]

Definition at line 195 of file Root_POA.inl.

{
  return ++this->outstanding_requests_;
}

CORBA::Object_ptr TAO_Root_POA::invoke_key_to_object ( void   ) 
CORBA::Object_ptr TAO_Root_POA::invoke_key_to_object_helper_i ( const char *  repository_id,
const PortableServer::ObjectId id 
)
Todo:
Temporarily for servant retention

Definition at line 1311 of file Root_POA.cpp.

{
  const PortableInterceptor::ObjectId &user_oid =
    reinterpret_cast <const PortableInterceptor::ObjectId &>(id);

  // Ask the ORT to create the object.
  if (this->ORT_adapter_i ())
    {
      // Ask the ORT to create the object.
      return this->ort_adapter_->make_object (repository_id,
                                              user_oid);
    }
  else
    {
      return this->invoke_key_to_object ();
    }
}

CORBA::Boolean TAO_Root_POA::is_persistent ( void   )  const

Definition at line 1282 of file Root_POA.cpp.

{
  return active_policy_strategies_.lifespan_strategy()->is_persistent ();
}

bool TAO_Root_POA::is_poa_generated ( CORBA::Object_ptr  reference,
PortableServer::ObjectId system_id 
)

Definition at line 1414 of file Root_POA.cpp.

{
  TAO::ObjectKey_var key = reference->_key ();

  TAO_Object_Adapter::poa_name poa_system_name;
  CORBA::Boolean is_root = false;
  CORBA::Boolean is_persistent = false;
  CORBA::Boolean is_system_id = false;
  TAO::Portable_Server::Temporary_Creation_Time poa_creation_time;

  int const result = this->parse_key (key.in (),
                                      poa_system_name,
                                      system_id,
                                      is_root,
                                      is_persistent,
                                      is_system_id,
                                      poa_creation_time);
  if (result != 0
      || (this->root () == 0 && poa_system_name != this->system_name ())
      || is_root != this->root ()
      || is_system_id != this->system_id ()
      || !this->validate_lifespan (is_persistent, poa_creation_time))
    {
      // The passed reference is NOT generated by this POA.
      return false;
    }
  else
    {
      // The passed reference is generated by this POA.
      return true;
    }
}

int TAO_Root_POA::is_poa_generated_id ( const PortableServer::ObjectId id  ) 

Definition at line 1837 of file Root_POA.cpp.

{
#if defined (POA_NAME_IN_POA_GENERATED_ID)

  // Grab the buffer
  const char *id_buffer = (const char *) id.get_buffer ();

  // Check to see if the POA name is the first part of the id
  return
    this->name_.length () < id.length () &&
    ACE_OS::strncmp (id_buffer,
                     this->name_.c_str (),
                     this->name_.length ()) == 0;
#else /* POA_NAME_IN_POA_GENERATED_ID */

  ACE_UNUSED_ARG (id);
  return 1;

#endif /* POA_NAME_IN_POA_GENERATED_ID */
}

bool TAO_Root_POA::is_servant_activation_allowed ( PortableServer::Servant  servant,
bool &  wait_occurred_restart_call 
)

Definition at line 2438 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.id_uniqueness_strategy ()->
    is_servant_activation_allowed (servant, wait_occurred_restart_call);
}

int TAO_Root_POA::is_servant_active ( PortableServer::Servant  servant,
bool &  wait_occurred_restart_call 
)

Definition at line 2503 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy ()->
    is_servant_in_map (servant, wait_occurred_restart_call);
}

CORBA::Object_ptr TAO_Root_POA::key_to_object ( const TAO::ObjectKey &  key,
const char *  type_id,
TAO_ServantBase servant,
CORBA::Boolean  collocated,
CORBA::Short  priority,
bool  indirect 
) [protected]

Wrapper for the ORB's key_to_object that will alter the object pointer if the ImplRepo is used.

Definition at line 1934 of file Root_POA.cpp.

{
  // Check if the ORB is still running, otherwise throw an exception.
  // @@ What if the ORB was destroyed?  In that case we shouldn't even
  //    get here!
  this->orb_core_.check_shutdown ();

  //
  // ImplRepo related.
  //
#if (TAO_HAS_MINIMUM_CORBA == 0)

  CORBA::Object_ptr obj = CORBA::Object::_nil ();

  if (indirect && this->active_policy_strategies_.lifespan_strategy()->use_imr ()
         && this->orb_core ().imr_endpoints_in_ior ())
    {
      // Check to see if we alter the IOR.
      CORBA::Object_var imr = this->orb_core ().implrepo_service ();

      if (CORBA::is_nil (imr.in ())
          || !imr->_stubobj ()
          || !imr->_stubobj ()->profile_in_use ())
        {
          if (TAO_debug_level > 1)
            {
              ACE_DEBUG ((LM_DEBUG,
                          "Missing ImR IOR, will not use the ImR\n"));
            }
          goto orbkey;
        }

      CORBA::String_var imr_str =
        imr->_stubobj ()->profile_in_use ()->to_string ();

      if (TAO_debug_level > 0)
        ACE_DEBUG ((LM_DEBUG,
                    "IMR IOR =\n%C\n",
                    imr_str.in ()));

      // Search for "corbaloc:" alone, without the protocol.  This code
      // should be protocol neutral.
      const char corbaloc[] = "corbaloc:";
      char *pos = ACE_OS::strstr (imr_str.inout (), corbaloc);
      pos = ACE_OS::strchr (pos + sizeof (corbaloc), ':');

      pos = ACE_OS::strchr (pos + 1,
                            imr->_stubobj ()->profile_in_use ()->object_key_delimiter ());

      if (pos)
        pos[1] = 0;  // Crop the string.
      else
        {
          if (TAO_debug_level > 0)
            ACE_ERROR ((LM_ERROR,
                        "Could not parse ImR IOR, skipping ImRification\n"));
          goto orbkey;
        }

      ACE_CString ior (imr_str.in ());

      // Add the key.

      CORBA::String_var key_str;
      TAO::ObjectKey::encode_sequence_to_string (key_str.inout (), key);

      ior += key_str.in ();

      if (TAO_debug_level > 0)
        ACE_DEBUG ((LM_DEBUG,
                    "ImR-ified IOR =\n%C\n",
                    ior.c_str ()));

      obj = this->orb_core_.orb ()->string_to_object (ior.c_str ());

      return obj;
    }

orbkey:

#else
  ACE_UNUSED_ARG (indirect);
#endif /* TAO_HAS_MINIMUM_CORBA */

  TAO_Stub *data = this->key_to_stub_i (key, type_id, priority);

  TAO_Stub_Auto_Ptr safe_data (data);

  CORBA::Object_ptr tmp;

  if (this->orb_core_.optimize_collocation_objects ())
    {
      ACE_NEW_THROW_EX (tmp, CORBA::Object (data,
                                            collocated,
                                            servant),
                        CORBA::INTERNAL ());

    }
  else
    {
      ACE_NEW_THROW_EX (tmp,
                        CORBA::Object (data,
                                       collocated),
                        CORBA::INTERNAL ());
    }

  data->servant_orb (this->orb_core_.orb ());

  // Transfer ownership to the Object.
  (void) safe_data.release ();

  return tmp;
}

TAO_Stub * TAO_Root_POA::key_to_stub ( const TAO::ObjectKey &  key,
const char *  type_id,
CORBA::Short  priority 
)

Create the correct stub, properly initialized with the attributes and policies attached to the current POA.

Definition at line 2054 of file Root_POA.cpp.

{
  // Check if the ORB is still running, otherwise throw an exception.
  // @@ What if the ORB was destroyed?  In that case we shouldn't even
  //    get here!
  this->orb_core_.check_shutdown ();

  return this->key_to_stub_i (key, type_id, priority);
}

TAO_Stub * TAO_Root_POA::key_to_stub_i ( const TAO::ObjectKey &  key,
const char *  type_id,
CORBA::Short  priority 
) [protected, virtual]

Like key_to_stub() but assume that the ORB is not shutting down.

Reimplemented in TAO_RT_POA.

Definition at line 2067 of file Root_POA.cpp.

{
  CORBA::PolicyList_var client_exposed_policies =
    this->client_exposed_policies (priority);

  TAO_Acceptor_Filter* filter = 0;

#if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
  if (this->filter_factory_)
    {
      filter = this->filter_factory_->create_object (this->poa_manager_);
    }
  else
#endif
    {
      ACE_NEW_RETURN (filter,
                      TAO_Default_Acceptor_Filter (),
                      0);
    }

  // Give ownership to the auto pointer.
  auto_ptr<TAO_Acceptor_Filter> new_filter (filter);

  TAO_Stub *data =
    this->create_stub_object (
      key,
      type_id,
      client_exposed_policies._retn (),
      filter,
      this->orb_core_.lane_resources ().acceptor_registry ());

  return data;
}

PortableServer::Servant TAO_Root_POA::locate_servant_i ( const char *  operation,
const PortableServer::ObjectId id,
TAO::Portable_Server::Servant_Upcall &  servant_upcall,
TAO::Portable_Server::POA_Current_Impl &  poa_current_impl,
bool &  wait_occurred_restart_call 
) [protected]

Definition at line 1555 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.request_processing_strategy()->
    locate_servant (operation,
                    system_id,
                    servant_upcall,
                    poa_current_impl,
                    wait_occurred_restart_call);
}

TAO_SERVANT_LOCATION TAO_Root_POA::locate_servant_i ( const PortableServer::ObjectId id,
PortableServer::Servant servant 
) [protected]

Definition at line 2255 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.request_processing_strategy()->
          locate_servant (system_id, servant);
}

ACE_Lock & TAO_Root_POA::lock ( void   ) 

Definition at line 14 of file Root_POA.inl.

{
  return this->lock_;
}

const ACE_CString & TAO_Root_POA::name ( void   )  const

Definition at line 87 of file Root_POA.inl.

{
  return this->name_;
}

char TAO_Root_POA::name_separator ( void   )  [static]

Definition at line 111 of file Root_POA.inl.

{
  return '\0';
}

CORBA::ULong TAO_Root_POA::name_separator_length ( void   )  [static]

Definition at line 117 of file Root_POA.inl.

{
  return sizeof (char);
}

TAO_Network_Priority_Hook * TAO_Root_POA::network_priority_hook ( void   ) 

obtain a handle to the network priority hooks

Definition at line 2518 of file Root_POA.cpp.

{
  return this->network_priority_hook_;
}

TAO_Root_POA * TAO_Root_POA::new_POA ( const String name,
PortableServer::POAManager_ptr  poa_manager,
const TAO_POA_Policy_Set policies,
TAO_Root_POA parent,
ACE_Lock lock,
TAO_SYNCH_MUTEX &  thread_lock,
TAO_ORB_Core orb_core,
TAO_Object_Adapter object_adapter 
) [protected, virtual]

Template method for creating new POA's of this type.

Reimplemented in TAO_CSD_POA, and TAO_RT_POA.

Definition at line 501 of file Root_POA.cpp.

{
  TAO_Regular_POA *poa = 0;

  ACE_NEW_THROW_EX (poa,
                    TAO_Regular_POA (name,
                             poa_manager,
                             policies,
                             parent,
                             lock,
                             thread_lock,
                             orb_core,
                             object_adapter),
                    CORBA::NO_MEMORY ());

  return poa;
}

char TAO_Root_POA::non_root_key_char ( void   )  [static, protected]

Definition at line 165 of file Root_POA.inl.

{
  return 'N';
}

TAO_Object_Adapter & TAO_Root_POA::object_adapter ( void   ) 

Definition at line 1910 of file Root_POA.cpp.

{
  return *this->object_adapter_;
}

TAO_ORB_Core & TAO_Root_POA::orb_core ( void   )  const

ORB Core for POA.

Reimplemented from CORBA::Object.

Definition at line 213 of file Root_POA.inl.

{
  return this->orb_core_;
}

TAO::ORT_Adapter * TAO_Root_POA::ORT_adapter ( void   )  [protected]

Get the ORT adapter, in case there is no adapter yet, this method will try to create one and hold the POA lock

Definition at line 2561 of file Root_POA.cpp.

{
  if (this->ort_adapter_ != 0)
    return this->ort_adapter_;

  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  // DCL ..
  if (this->ort_adapter_ != 0)
    {
      return this->ort_adapter_;
    }

  return this->ORT_adapter_i ();
}

TAO::ORT_Adapter_Factory * TAO_Root_POA::ORT_adapter_factory ( void   )  [protected]
void TAO_Root_POA::ort_adapter_factory_name ( const char *  name  )  [static]
const char * TAO_Root_POA::ort_adapter_factory_name ( void   )  [static]
TAO::ORT_Adapter * TAO_Root_POA::ORT_adapter_i ( void   )  [protected]

Get the ORT adapter, in case there is no adapter yet, this method will try to create one but assumes the POA lock is already hold

Definition at line 2300 of file Root_POA.cpp.

{
  if (this->ort_adapter_ != 0)
    return this->ort_adapter_;

  try
    {
      TAO::ORT_Adapter_Factory * ort_ap_factory = this->ORT_adapter_factory ();

      if (!ort_ap_factory)
        return 0;

      // Get the full adapter name of this POA, do this before we
      // create the adapter so that in case this fails, we just
      // return 0 and not a not activated adapter
      PortableInterceptor::AdapterName *adapter_name = this->adapter_name_i ();

      this->ort_adapter_ = ort_ap_factory->create ();

      if (!this->ort_adapter_)
        return 0;

      // @todo We have to look at this, we activate it but hold the POA lock,
      // in case we are called by ORT_adapter, we shouldn't keep the lock
      // here, but then the ort_adapter should be guarded against multiple
      // activations.
      this->ort_adapter_->activate (this->orb_core_.server_id (),
                                    this->orb_core_.orbid (),
                                    adapter_name,
                                    this);
    }
  catch (const ::CORBA::Exception& ex)
    {
      ex._tao_print_exception (
        "(%P|%t) Cannot initialize the "
        "object_reference_template_adapter\n");
    }

  return this->ort_adapter_;
}

void TAO_Root_POA::outstanding_requests ( CORBA::ULong  new_outstanding_requests  )  [protected]

Definition at line 189 of file Root_POA.inl.

{
  this->outstanding_requests_ = new_outstanding_requests;
}

CORBA::ULong TAO_Root_POA::outstanding_requests ( void   )  const

Definition at line 183 of file Root_POA.inl.

{
  return this->outstanding_requests_;
}

int TAO_Root_POA::parse_ir_object_key ( const TAO::ObjectKey &  object_key,
PortableServer::ObjectId user_id 
) [static]

Calls protected static method used when POACurrent is not appropriate.

Definition at line 1891 of file Root_POA.cpp.

{
  TAO_Object_Adapter::poa_name poa_system_name;
  CORBA::Boolean is_root = false;
  CORBA::Boolean is_persistent = false;
  CORBA::Boolean is_system_id = false;
  TAO::Portable_Server::Temporary_Creation_Time poa_creation_time;

  return TAO_Root_POA::parse_key (object_key,
                                  poa_system_name,
                                  user_id,
                                  is_root,
                                  is_persistent,
                                  is_system_id,
                                  poa_creation_time);
}

int TAO_Root_POA::parse_key ( const TAO::ObjectKey &  key,
TAO_Object_Adapter::poa_name poa_system_name,
PortableServer::ObjectId system_id,
CORBA::Boolean is_root,
CORBA::Boolean is_persistent,
CORBA::Boolean is_system_id,
TAO::Portable_Server::Temporary_Creation_Time &  poa_creation_time 
) [static, protected]

Definition at line 1571 of file Root_POA.cpp.

{
  // Get the object key octets.
  const CORBA::Octet *key_data = key.get_buffer ();

  // Skip the object key prefix since we have already checked for this.
  CORBA::ULong starting_at = TAO_OBJECTKEY_PREFIX_SIZE;

  // Check the root indicator.
  char root_key_type = key_data[starting_at];
  if (root_key_type == TAO_Root_POA::root_key_char ())
    {
      is_root = true;
    }
  else if (root_key_type == TAO_Root_POA::non_root_key_char ())
    {
      is_root = false;
    }
  else
    {
      // Incorrect key
      return -1;
    }

  // Skip past the system id indicator
  starting_at += TAO_Root_POA::root_key_type_length ();

  // Check the system id indicator.
  char system_id_key_type = key_data[starting_at];
  if (system_id_key_type == TAO_Root_POA::system_id_key_char ())
    {
      is_system_id = true;
    }
  else if (system_id_key_type == TAO_Root_POA::user_id_key_char ())
    {
      is_system_id = false;
    }
  else
    {
      // Incorrect key
      return -1;
    }

  // Skip past the system id indicator
  starting_at += TAO_Root_POA::system_id_key_type_length ();

  // Check the persistence indicator
  char persistent_key_type = key_data[starting_at];
  if (persistent_key_type == TAO_Root_POA::persistent_key_char ())
    {
      is_persistent = true;
    }
  else if (persistent_key_type == TAO_Root_POA::transient_key_char ())
    {
      is_persistent = false;
    }
  else
    {
      // Incorrect key
      return -1;
    }

  // Skip past the persistent indicator
  starting_at += TAO_Root_POA::persistent_key_type_length ();

#if (POA_NO_TIMESTAMP == 0)
  // Grab the timestamp for transient POAs.
  if (!is_persistent)
    {
      // Take the creation time for the timestamp
      poa_creation_time.creation_time (key_data + starting_at);

      // Skip past the timestamp
      starting_at += TAO::Portable_Server::Creation_Time::creation_time_length ();
    }
#else
  ACE_UNUSED_ARG (poa_creation_time);
#endif /* POA_NO_TIMESTAMP */

  // Calculate the size of the POA name.
  CORBA::ULong poa_name_size = 0;
  if (!is_persistent)
    {
      // Transient POAs have fixed size.
      poa_name_size = TAO_Object_Adapter::transient_poa_name_size ();
    }
  else if (is_system_id)
    {
      // System ids have fixed size.
      poa_name_size = static_cast <CORBA::ULong>
                                  (key.length () - starting_at -
                                   TAO_Active_Object_Map::system_id_size ());
    }
  else
    {
      // Get the size from the object key.
      ACE_OS::memcpy (&poa_name_size,
                      key_data + starting_at,
                      sizeof (poa_name_size));
      poa_name_size = ACE_NTOHL (poa_name_size);

      starting_at += sizeof (poa_name_size);
    }

  // Grep the name if there is a name
  if (!is_root)
    {
      poa_system_name.replace (poa_name_size,
                               poa_name_size,
                               (CORBA::Octet *) key_data + starting_at,
                               0);

      starting_at += poa_name_size;
    }

  // The rest is the system id.
  CORBA::ULong system_id_size = key.length () - starting_at;

  // Reset <system_id>.
  system_id.length (system_id_size);
  CORBA::Octet * buf = system_id.get_buffer ();
  ACE_OS::memcpy (buf, key_data + starting_at, system_id_size);

  // Success
  return 0;
}

CORBA::Boolean TAO_Root_POA::persistent ( void   )  [protected]

Definition at line 81 of file Root_POA.inl.

{
  return (this->cached_policies_.lifespan () == PortableServer::PERSISTENT);
}

char TAO_Root_POA::persistent_key_char ( void   )  [static, protected]

Definition at line 123 of file Root_POA.inl.

{
  return 'P';
}

CORBA::ULong TAO_Root_POA::persistent_key_type_length ( void   )  [static, protected]

Definition at line 135 of file Root_POA.inl.

{
  return sizeof (char);
}

void TAO_Root_POA::poa_activated_hook (  )  [virtual]

Hook - The POA has been (or is being) activated.

These hooks are needed by the CSD strategy to override and no-ops by default.

Reimplemented in TAO_CSD_POA.

Definition at line 2707 of file Root_POA.cpp.

{
}

void TAO_Root_POA::poa_deactivated_hook (  )  [virtual]

Hook - The POA has been deactivated.

Reimplemented in TAO_CSD_POA.

Definition at line 2712 of file Root_POA.cpp.

{
}

TAO_POA_Policy_Set & TAO_Root_POA::policies ( void   ) 

Accessor for POA policies.

Definition at line 20 of file Root_POA.inl.

{
  return this->policies_;
}

void TAO_Root_POA::post_invoke_servant_cleanup ( const PortableServer::ObjectId system_id,
const TAO::Portable_Server::Servant_Upcall &  servant_upcall 
)

Definition at line 2488 of file Root_POA.cpp.

{
  this->active_policy_strategies_.request_processing_strategy ()->
    post_invoke_servant_cleanup (system_id, servant_upcall);
}

TAO::Portable_Server::Cached_Policies::PriorityModel TAO_Root_POA::priority_model ( void   )  const

Definition at line 2524 of file Root_POA.cpp.

{
  return cached_policies_.priority_model ();
}

int TAO_Root_POA::rebind_using_user_id_and_system_id ( PortableServer::Servant  servant,
const PortableServer::ObjectId user_id,
const PortableServer::ObjectId system_id,
TAO::Portable_Server::Servant_Upcall &  servant_upcall 
)

Definition at line 2453 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy ()->
    rebind_using_user_id_and_system_id (servant,
                                        user_id,
                                        system_id,
                                        servant_upcall);
}

PortableServer::ObjectId * TAO_Root_POA::reference_to_id ( CORBA::Object_ptr  reference  ) 

Reimplemented in TAO_RT_POA.

Definition at line 1449 of file Root_POA.cpp.

{
  // Make sure that the reference is valid.
  if (CORBA::is_nil (reference))
    {
      throw ::CORBA::BAD_PARAM ();
    }

  // The WrongPolicy exception is declared to allow future extensions.

  // This operation is valid only if the reference was created by the
  // POA on which the operation is being performed.  If the object
  // reference was not created by this POA, the WrongAdapter exception
  // is raised.
  PortableServer::ObjectId system_id;
  bool const is_generated = this->is_poa_generated (reference, system_id);

  if (!is_generated)
    {
      throw PortableServer::POA::WrongAdapter ();
    }

  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->active_policy_strategies_.servant_retention_strategy()->
    system_id_to_object_id (system_id);
}

PortableServer::Servant TAO_Root_POA::reference_to_servant ( CORBA::Object_ptr  reference  ) 

Reimplemented in TAO_RT_POA.

Definition at line 725 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->reference_to_servant_i (reference);
}

PortableServer::Servant TAO_Root_POA::reference_to_servant_i ( CORBA::Object_ptr  reference  )  [protected]

Definition at line 1371 of file Root_POA.cpp.

{
  // Make sure that the reference is valid.
  if (CORBA::is_nil (reference))
    {
      throw ::CORBA::BAD_PARAM ();
    }

  PortableServer::ObjectId system_id;
  bool const is_generated =
    this->is_poa_generated (reference, system_id);

  if (!is_generated)
    {
      // In case this object reference is not generated by this POA throw
      // an exception
      throw PortableServer::POA::WrongAdapter ();
    }

  PortableServer::Servant servant =
    this->active_policy_strategies_.request_processing_strategy()->
      system_id_to_servant (system_id);

  if (servant != 0)
    {
      // ATTENTION: Trick locking here, see class header for details
      TAO::Portable_Server::Non_Servant_Upcall non_servant_upcall (*this);
      ACE_UNUSED_ARG (non_servant_upcall);

      // The POA invokes _add_ref once on the Servant before returning
      // it. If the application uses reference counting, the caller of
      // id_to_servant is responsible for invoking _remove_ref once on
      // the returned Servant when it is finished with it. A
      // conforming caller need not invoke _remove_ref on the returned
      // Servant if the type of the Servant uses the default reference
      // counting inherited from ServantBase.
      servant->_add_ref ();
    }

  return servant;
}

void TAO_Root_POA::remove_from_parent_i ( void   )  [protected, virtual]

Reimplemented in TAO_Regular_POA.

Definition at line 796 of file Root_POA.cpp.

{
  // The root poa has no parent, so this is a noop
}

CORBA::Boolean TAO_Root_POA::root ( void   )  const [protected, virtual]

Reimplemented in TAO_Regular_POA.

Definition at line 2555 of file Root_POA.cpp.

{
  return true;
}

char TAO_Root_POA::root_key_char ( void   )  [static, protected]

Definition at line 159 of file Root_POA.inl.

{
  return 'R';
}

char TAO_Root_POA::root_key_type ( void   )  [protected, virtual]

Reimplemented in TAO_Regular_POA.

Definition at line 171 of file Root_POA.inl.

CORBA::ULong TAO_Root_POA::root_key_type_length ( void   )  [static, protected]

Definition at line 177 of file Root_POA.inl.

{
  return sizeof (char);
}

void TAO_Root_POA::save_ior_component ( const IOP::TaggedComponent &  component  ) 

Store the given TaggedComponent for eventual insertion into all object reference profiles.

Definition at line 2128 of file Root_POA.cpp.

{
  CORBA::ULong const old_len = this->tagged_component_.length ();

  this->tagged_component_.length (old_len + 1);
  this->tagged_component_[old_len] = component;
}

void TAO_Root_POA::save_ior_component_and_profile_id ( const IOP::TaggedComponent &  component,
IOP::ProfileId  profile_id 
)

Store the given TaggedComponent for eventual insertion into all object reference profiles with the given ProfileId.

Definition at line 2138 of file Root_POA.cpp.

{
  // The length of this->tagged_component_id_ is the same as the
  // length of the profile_id_array_ since we are trying to make a
  // one-to-one link between these two arrays. So, whenever
  // this->tagged_component_id_ is increased, we need to increase the
  // size of this->profile_id_array_ also.

  CORBA::ULong const old_len = this->tagged_component_id_.length ();

  CORBA::ULong const new_len = old_len + 1;

  this->tagged_component_id_.length (new_len);
  this->tagged_component_id_[old_len] = component;

  this->profile_id_array_.size (new_len);
  this->profile_id_array_[old_len] = profile_id;
}

void TAO_Root_POA::servant_activated_hook ( PortableServer::Servant  servant,
const PortableServer::ObjectId oid 
) [virtual]

Hook - A servant has been activated.

Reimplemented in TAO_CSD_POA.

Definition at line 2717 of file Root_POA.cpp.

{
}

void TAO_Root_POA::servant_deactivated_hook ( PortableServer::Servant  servant,
const PortableServer::ObjectId oid 
) [virtual]

Hook - A servant has been deactivated.

Reimplemented in TAO_CSD_POA.

Definition at line 2723 of file Root_POA.cpp.

{
}

TAO_SYNCH_CONDITION & TAO_Root_POA::servant_deactivation_condition ( void   ) 

Definition at line 231 of file Root_POA.inl.

CORBA::Boolean TAO_Root_POA::servant_has_remaining_activations ( PortableServer::Servant  servant  ) 

Definition at line 2467 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy ()->
    servant_has_remaining_activations (servant);
}

TAO_SERVANT_LOCATION TAO_Root_POA::servant_present ( const PortableServer::ObjectId system_id,
PortableServer::Servant servant 
)

Definition at line 2263 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
          servant_present (system_id, servant);
}

PortableServer::ObjectId * TAO_Root_POA::servant_to_id ( PortableServer::Servant  p_servant  ) 

Reimplemented in TAO_RT_POA.

Definition at line 707 of file Root_POA.cpp.

{
  // If we had upgradeable locks, this would initially be a read lock
  //
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->servant_to_id_i (servant);
}

PortableServer::ObjectId * TAO_Root_POA::servant_to_id_i ( PortableServer::Servant  servant  ) 

Definition at line 1357 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.request_processing_strategy()->
    servant_to_id (servant);
}

CORBA::Object_ptr TAO_Root_POA::servant_to_reference ( PortableServer::Servant  p_servant  ) 

Reimplemented in TAO_RT_POA.

Definition at line 734 of file Root_POA.cpp.

CORBA::Object_ptr TAO_Root_POA::servant_to_reference_i ( PortableServer::Servant  p_servant  )  [protected]

Definition at line 1364 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    servant_to_reference (servant);
}

PortableServer::ObjectId * TAO_Root_POA::servant_to_user_id ( PortableServer::Servant  p_servant  ) 

Definition at line 718 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    servant_to_user_id (servant);
}

CORBA::Short TAO_Root_POA::server_priority ( void   )  const

Definition at line 2497 of file Root_POA.cpp.

{
  return this->cached_policies_.server_priority ();
}

CORBA::Policy * TAO_Root_POA::server_protocol ( void   )  [virtual]

Definition at line 2579 of file Root_POA.cpp.

{
  return 0;
}

void TAO_Root_POA::set_folded_name ( TAO_Root_POA parent  )  [protected]

Definition at line 1859 of file Root_POA.cpp.

{
  size_t length = 0;
  size_t parent_length = 0;

  if (parent != 0)
    {
      parent_length = parent->folded_name ().length ();
      length += parent_length;
    }

  length += this->name_.length ();
  length += TAO_Root_POA::name_separator_length ();

  this->folded_name_.length (static_cast <CORBA::ULong> (length));
  CORBA::Octet *folded_name_buffer = this->folded_name_.get_buffer ();

  if (parent != 0)
    {
      ACE_OS::memcpy (folded_name_buffer,
                      parent->folded_name ().get_buffer (),
                      parent_length);
    }

  ACE_OS::memcpy (&folded_name_buffer[parent_length],
                  this->name_.c_str (),
                  this->name_.length ());

  folded_name_buffer[length - TAO_Root_POA::name_separator_length ()] = TAO_Root_POA::name_separator ();
}

void TAO_Root_POA::set_id ( TAO_Root_POA parent  )  [protected]

Definition at line 1739 of file Root_POA.cpp.

{
  // Calculate the prefix size.
  CORBA::ULong prefix_size = 0;
  prefix_size += TAO_OBJECTKEY_PREFIX_SIZE;

  // If we are dealing with a persistent POA and user ids are being
  // used, then we need to add the POA name length field to the object
  // key. Otherwise, the POA name length can be calculated by looking
  // at the remainder after extracting other parts of the key.
  bool const add_poa_name_length =
    this->is_persistent () &&
    !this->system_id ();

  // Size required by the POA name.
  CORBA::ULong poa_name = 0;

  // Calculate the space required for the POA name.
  CORBA::ULong poa_name_length = this->system_name_->length ();
  if (parent != 0)
    {
      poa_name += poa_name_length;
    }

  // Check if we need to added the length of the POA name.
  if (add_poa_name_length)
    {
      poa_name += sizeof (poa_name_length);
    }

  // Get the space needed for the lifespan length
  // byte.
  CORBA::ULong const lifespan_key_length =
    this->active_policy_strategies_.lifespan_strategy()->key_length ();

  CORBA::ULong const id_assignment_key_length =
    this->active_policy_strategies_.id_assignment_strategy()->key_type_length ();

  // Calculate the space required for the POA id.
  CORBA::ULong const buffer_size =
    prefix_size +
    this->root_key_type_length () +
    id_assignment_key_length +
    lifespan_key_length +
    poa_name;

  // Create the buffer for the POA id.
  this->id_.length (buffer_size);
  CORBA::Octet *buffer = &this->id_[0];

  // Keeps track of where the next infomation goes; start at 0 byte.
  CORBA::ULong starting_at = 0;

  // Add the object key prefix.
  ACE_OS::memcpy (&buffer[starting_at],
                  &objectkey_prefix[0],
                  TAO_OBJECTKEY_PREFIX_SIZE);

  starting_at += TAO_OBJECTKEY_PREFIX_SIZE;

  // Copy the root byte.
  if (parent != 0)
    {
      buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::non_root_key_char ();
    }
  else
    {
      buffer[starting_at] = (CORBA::Octet) TAO_Root_POA::root_key_char ();
    }
  starting_at += this->root_key_type_length ();

  // Add the id_assignment part
  this->active_policy_strategies_.id_assignment_strategy()->create_key (buffer, starting_at);

  // Add the lifespan part
  this->active_policy_strategies_.lifespan_strategy()->create_key (buffer, starting_at);

  // Check if we need to added the length of the POA name.
  if (add_poa_name_length)
    {
      poa_name_length = ACE_HTONL (poa_name_length);
      ACE_OS::memcpy (&buffer[starting_at],
                      &poa_name_length,
                      sizeof (poa_name_length));
      starting_at += sizeof (poa_name_length);
    }

  // Put the POA name into the key (for non-root POAs).
  if (parent != 0)
    {
      ACE_OS::memcpy (&buffer[starting_at],
                      this->system_name_->get_buffer (),
                      this->system_name_->length ());
      starting_at += this->system_name_->length ();
    }
}

void TAO_Root_POA::set_obj_ref_factory ( PortableInterceptor::ObjectReferenceFactory *  current_factory  )  [protected]

Set the object reference factory.

Definition at line 174 of file Root_POA.cpp.

{
  TAO::ORT_Adapter *adapter = this->ORT_adapter ();

  if (adapter)
    {
      // Activate a different factory
      this->ort_adapter_->set_obj_ref_factory (current_factory);
    }
}

void TAO_Root_POA::set_servant ( PortableServer::Servant  servant  ) 

Reimplemented in TAO_RT_POA.

Definition at line 2426 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD;

  this->active_policy_strategies_.request_processing_strategy()->
    set_servant (servant);
}

void TAO_Root_POA::set_servant_manager ( PortableServer::ServantManager_ptr  imgr  ) 

Reimplemented in TAO_RT_POA.

Definition at line 2376 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD;

  this->active_policy_strategies_.request_processing_strategy()->
    set_servant_manager (imgr);
}

CORBA::Boolean TAO_Root_POA::system_id ( void   ) 

Definition at line 75 of file Root_POA.inl.

{
  return (this->cached_policies_.id_assignment () == PortableServer::SYSTEM_ID);
}

char TAO_Root_POA::system_id_key_char ( void   )  [static, protected]

Definition at line 141 of file Root_POA.inl.

{
  return 'S';
}

CORBA::ULong TAO_Root_POA::system_id_key_type_length ( void   )  [static, protected]

Definition at line 153 of file Root_POA.inl.

{
  return sizeof (char);
}

const TAO_Object_Adapter::poa_name & TAO_Root_POA::system_name ( void   )  const

Definition at line 105 of file Root_POA.inl.

{
  return this->system_name_.in ();
}

TAO_POA_Manager & TAO_Root_POA::tao_poa_manager (  ) 

Return the POA Manager related to this POA.

Definition at line 688 of file Root_POA.cpp.

{
  return poa_manager_;
}

PortableServer::AdapterActivator_ptr TAO_Root_POA::the_activator ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 2344 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (PortableServer::AdapterActivator::_nil ());

  return PortableServer::AdapterActivator::_duplicate (this->adapter_activator_.in ());
}

void TAO_Root_POA::the_activator ( PortableServer::AdapterActivator_ptr  adapter_activator  ) 

Reimplemented in TAO_RT_POA.

Definition at line 2353 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD;

  this->adapter_activator_ = PortableServer::AdapterActivator::_duplicate (adapter_activator);
}

PortableServer::POAList * TAO_Root_POA::the_children ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 742 of file Root_POA.cpp.

{
  // Lock access for the duration of this transaction.
  TAO_POA_GUARD_RETURN (0);

  return this->the_children_i ();
}

PortableServer::POAList * TAO_Root_POA::the_children_i ( void   )  [protected]

Definition at line 979 of file Root_POA.cpp.

{
  PortableServer::POAList_var children;
  CORBA::ULong child_current = static_cast <CORBA::ULong>
                                           (this->children_.current_size ());
  ACE_NEW_THROW_EX (children,
                    PortableServer::POAList (child_current),
                    CORBA::NO_MEMORY ());

  children->length (child_current);

  CORBA::ULong index = 0;
  for (CHILDREN::iterator iterator = this->children_.begin ();
       iterator != this->children_.end ();
       ++iterator, ++index)
    {
      TAO_Root_POA *child_poa = (*iterator).int_id_;
      children[index] = PortableServer::POA::_duplicate (child_poa);
    }

  return children._retn ();
}

char * TAO_Root_POA::the_name ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 93 of file Root_POA.inl.

{
  return CORBA::string_dup (this->name_.c_str ());
}

PortableServer::POA_ptr TAO_Root_POA::the_parent ( void   ) 

Reimplemented in TAO_Regular_POA, and TAO_RT_POA.

Definition at line 26 of file Root_POA.inl.

PortableServer::POAManager_ptr TAO_Root_POA::the_POAManager ( void   ) 

Reimplemented in TAO_RT_POA.

Definition at line 2645 of file Root_POA.cpp.

PortableServer::POAManagerFactory_ptr TAO_Root_POA::the_POAManagerFactory ( void   ) 

Definition at line 2652 of file Root_POA.cpp.

void * TAO_Root_POA::thread_pool ( void   )  const [virtual]

Reimplemented in TAO_RT_POA.

Definition at line 225 of file Root_POA.inl.

{
  return 0;
}

char TAO_Root_POA::transient_key_char ( void   )  [static, protected]

Definition at line 129 of file Root_POA.inl.

{
  return 'T';
}

int TAO_Root_POA::unbind_using_user_id ( const PortableServer::ObjectId user_id  ) 

Definition at line 1486 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    unbind_using_user_id  (user_id);
}

char TAO_Root_POA::user_id_key_char ( void   )  [static, protected]

Definition at line 147 of file Root_POA.inl.

{
  return 'U';
}

PortableServer::Servant TAO_Root_POA::user_id_to_servant_i ( const PortableServer::ObjectId oid  ) 

Definition at line 1529 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy()->
    user_id_to_servant (id);
}

bool TAO_Root_POA::validate_lifespan ( CORBA::Boolean  is_persistent,
const TAO::Portable_Server::Temporary_Creation_Time &  creation_time 
) const

Definition at line 2546 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.lifespan_strategy()->
    validate (is_persistent, creation_time);
}

void TAO_Root_POA::wait_for_completions ( CORBA::Boolean  wait_for_completion  )  [protected]

Definition at line 1202 of file Root_POA.cpp.

{
  while (this->object_adapter ().enable_locking_ &&
         wait_for_completion &&
         this->outstanding_requests_ > 0)
    {
      this->wait_for_completion_pending_ = 1;

      int result = this->outstanding_requests_condition_.wait ();
      if (result == -1)
        {
          throw ::CORBA::OBJ_ADAPTER ();
        }
    }
}

CORBA::Boolean TAO_Root_POA::waiting_destruction ( void   )  const

Definition at line 207 of file Root_POA.inl.

{
  return this->waiting_destruction_;
}

CORBA::ULong TAO_Root_POA::waiting_servant_deactivation ( void   )  const

Definition at line 2601 of file Root_POA.cpp.

{
  return this->active_policy_strategies_.servant_retention_strategy ()->
          waiting_servant_deactivation ();
}


Friends And Related Function Documentation

friend class TAO::Portable_Server::Non_Servant_Upcall [friend]

Definition at line 122 of file Root_POA.h.

friend class TAO::Portable_Server::Servant_Upcall [friend]

Definition at line 121 of file Root_POA.h.

friend class TAO_IORInfo [friend]

Definition at line 125 of file Root_POA.h.

friend class TAO_Object_Adapter [friend]

Definition at line 120 of file Root_POA.h.

friend class TAO_POA_Manager [friend]

Definition at line 123 of file Root_POA.h.

friend class TAO_RT_Collocation_Resolver [friend]

Definition at line 124 of file Root_POA.h.


Member Data Documentation

TAO::Portable_Server::Active_Policy_Strategies TAO_Root_POA::active_policy_strategies_ [protected]

Definition at line 713 of file Root_POA.h.

PortableServer::AdapterActivator_var TAO_Root_POA::adapter_activator_ [protected]

Definition at line 716 of file Root_POA.h.

PortableInterceptor::AdapterState TAO_Root_POA::adapter_state_ [protected]

Adapter can be accepting, rejecting etc.

Definition at line 707 of file Root_POA.h.

TAO::Portable_Server::Cached_Policies TAO_Root_POA::cached_policies_ [protected]

Definition at line 709 of file Root_POA.h.

Definition at line 755 of file Root_POA.h.

Definition at line 728 of file Root_POA.h.

Definition at line 737 of file Root_POA.h.

Definition at line 750 of file Root_POA.h.

Definition at line 697 of file Root_POA.h.

CORBA::OctetSeq TAO_Root_POA::id_ [protected]

Definition at line 701 of file Root_POA.h.

Definition at line 776 of file Root_POA.h.

Definition at line 730 of file Root_POA.h.

Definition at line 679 of file Root_POA.h.

Definition at line 711 of file Root_POA.h.

The object adapter we belong to.

Definition at line 735 of file Root_POA.h.

Initial value:
 {
  024, 
  001, 
  017, 
  000
}

Definition at line 280 of file Root_POA.h.

Cached pointer of our ORB_Core.

Be aware that this pointer can be zero or not. In fact there are two ways to get this pointer filled:

  • If CORBA::Object is constructed through one of the constructors with a stub and null ORB_Core, we use the orb_core from the stub to fill this pointer
  • If the other constructor, which uses IOP::IOR is used, a stub needs to be created first (i.e., the IOR needs to be evaluated first), in which case the ORB_Core would be null. The orb_core pointer then needs to be accessed from the stub and passed back as part of _get_orb().

Reimplemented from CORBA::Object.

Definition at line 732 of file Root_POA.h.

TAO::ORT_Adapter* TAO_Root_POA::ort_adapter_ [protected]

Pointer to the object reference template adapter.

Definition at line 704 of file Root_POA.h.

Definition at line 739 of file Root_POA.h.

TAO_SYNCH_CONDITION TAO_Root_POA::outstanding_requests_condition_ [protected]

Definition at line 741 of file Root_POA.h.

Reference to the POAManager that this poa assicuates with.

Definition at line 682 of file Root_POA.h.

Reference to the POAManagerFactory that generate the POAManager.

Definition at line 686 of file Root_POA.h.

Definition at line 695 of file Root_POA.h.

ACE_Array_Base<IOP::ProfileId> TAO_Root_POA::profile_id_array_ [protected]

Definition at line 693 of file Root_POA.h.

TAO_SYNCH_CONDITION TAO_Root_POA::servant_deactivation_condition_ [protected]

Definition at line 747 of file Root_POA.h.

Definition at line 757 of file Root_POA.h.

Definition at line 699 of file Root_POA.h.

IOP::TaggedComponentSeq TAO_Root_POA::tagged_component_ [protected]

Definition at line 689 of file Root_POA.h.

IOP::TaggedComponentSeq TAO_Root_POA::tagged_component_id_ [protected]

Definition at line 691 of file Root_POA.h.

Definition at line 743 of file Root_POA.h.

Definition at line 745 of file Root_POA.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines