diff options
Diffstat (limited to 'TAO/tao/POA.h')
-rw-r--r-- | TAO/tao/POA.h | 829 |
1 files changed, 429 insertions, 400 deletions
diff --git a/TAO/tao/POA.h b/TAO/tao/POA.h index fdd7869cf80..78b5888260d 100644 --- a/TAO/tao/POA.h +++ b/TAO/tao/POA.h @@ -51,24 +51,10 @@ // Active Object Table #include "tao/Active_Object_Map.h" -// POA Manager -#include "tao/POAManager.h" - -// Object Adapter -#include "tao/Object_Adapter.h" - -// This is to remove "inherits via dominance" warnings from MSVC. -// MSVC is being a little too paranoid. -#if defined (_MSC_VER) -# pragma warning (disable : 4250) -#endif /* _MSC_VER */ - class TAO_POA; +class TAO_POA_Manager; -#if !defined (TAO_HAS_MINIMUM_CORBA) - -class TAO_Export TAO_Thread_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::ThreadPolicy +class TAO_Export TAO_Thread_Policy : public POA_PortableServer::ThreadPolicy { public: TAO_Thread_Policy (PortableServer::ThreadPolicyValue value, @@ -76,15 +62,15 @@ public: TAO_Thread_Policy (const TAO_Thread_Policy &new_policy); - PortableServer::ThreadPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ThreadPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ThreadPolicyValue value_; @@ -92,10 +78,7 @@ protected: PortableServer::POA_var poa_; }; -#endif /* TAO_HAS_MINIMUM_CORBA */ - -class TAO_Export TAO_Lifespan_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::LifespanPolicy +class TAO_Export TAO_Lifespan_Policy : public POA_PortableServer::LifespanPolicy { public: TAO_Lifespan_Policy (PortableServer::LifespanPolicyValue value, @@ -103,15 +86,15 @@ public: TAO_Lifespan_Policy (const TAO_Lifespan_Policy &rhs); - PortableServer::LifespanPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::LifespanPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::LifespanPolicyValue value_; @@ -119,8 +102,7 @@ protected: PortableServer::POA_var poa_; }; -class TAO_Export TAO_Id_Uniqueness_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::IdUniquenessPolicy +class TAO_Export TAO_Id_Uniqueness_Policy : public POA_PortableServer::IdUniquenessPolicy { public: TAO_Id_Uniqueness_Policy (PortableServer::IdUniquenessPolicyValue value, @@ -128,15 +110,15 @@ public: TAO_Id_Uniqueness_Policy (const TAO_Id_Uniqueness_Policy &rhs); - PortableServer::IdUniquenessPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::IdUniquenessPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::IdUniquenessPolicyValue value_; @@ -144,8 +126,7 @@ protected: PortableServer::POA_var poa_; }; -class TAO_Export TAO_Id_Assignment_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::IdAssignmentPolicy +class TAO_Export TAO_Id_Assignment_Policy : public POA_PortableServer::IdAssignmentPolicy { public: TAO_Id_Assignment_Policy (PortableServer::IdAssignmentPolicyValue value, @@ -153,15 +134,15 @@ public: TAO_Id_Assignment_Policy (const TAO_Id_Assignment_Policy &rhs); - PortableServer::IdAssignmentPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::IdAssignmentPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::IdAssignmentPolicyValue value_; @@ -169,10 +150,7 @@ protected: PortableServer::POA_var poa_; }; -#if !defined (TAO_HAS_MINIMUM_CORBA) - -class TAO_Export TAO_Implicit_Activation_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::ImplicitActivationPolicy +class TAO_Export TAO_Implicit_Activation_Policy : public POA_PortableServer::ImplicitActivationPolicy { public: TAO_Implicit_Activation_Policy (PortableServer::ImplicitActivationPolicyValue value, @@ -180,15 +158,15 @@ public: TAO_Implicit_Activation_Policy (const TAO_Implicit_Activation_Policy &rhs); - PortableServer::ImplicitActivationPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ImplicitActivationPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ImplicitActivationPolicyValue value_; @@ -196,8 +174,7 @@ protected: PortableServer::POA_var poa_; }; -class TAO_Export TAO_Servant_Retention_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::ServantRetentionPolicy +class TAO_Export TAO_Servant_Retention_Policy : public POA_PortableServer::ServantRetentionPolicy { public: TAO_Servant_Retention_Policy (PortableServer::ServantRetentionPolicyValue value, @@ -205,15 +182,15 @@ public: TAO_Servant_Retention_Policy (const TAO_Servant_Retention_Policy &rhs); - PortableServer::ServantRetentionPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ServantRetentionPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::ServantRetentionPolicyValue value_; @@ -221,8 +198,7 @@ protected: PortableServer::POA_var poa_; }; -class TAO_Export TAO_Request_Processing_Policy : public virtual PortableServer::RefCountServantBase, - public virtual POA_PortableServer::RequestProcessingPolicy +class TAO_Export TAO_Request_Processing_Policy : public POA_PortableServer::RequestProcessingPolicy { public: TAO_Request_Processing_Policy (PortableServer::RequestProcessingPolicyValue value, @@ -230,15 +206,15 @@ public: TAO_Request_Processing_Policy (const TAO_Request_Processing_Policy &rhs); - PortableServer::RequestProcessingPolicyValue value (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::RequestProcessingPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Policy_ptr copy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::PolicyType policy_type (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr _default_POA (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: PortableServer::RequestProcessingPolicyValue value_; @@ -246,7 +222,35 @@ protected: PortableServer::POA_var poa_; }; -#endif /* TAO_HAS_MINIMUM_CORBA */ +// ************************************************** +// +// TAO spcific POA locking policy (non-standard) +// +// ************************************************** + +class TAO_Export TAO_Synchronization_Policy : public POA_PortableServer::SynchronizationPolicy +{ +public: + TAO_Synchronization_Policy (PortableServer::SynchronizationPolicyValue value, + PortableServer::POA_ptr poa); + + TAO_Synchronization_Policy (const TAO_Synchronization_Policy &rhs); + + virtual PortableServer::SynchronizationPolicyValue value (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual CORBA::Policy_ptr copy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual void destroy (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual CORBA::PolicyType policy_type (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + // virtual PortableServer::POA_ptr _default_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + +protected: + PortableServer::SynchronizationPolicyValue value_; + + PortableServer::POA_var poa_; +}; class TAO_Export TAO_POA_Policies { @@ -254,40 +258,45 @@ public: TAO_POA_Policies (void); -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ThreadPolicyValue thread (void) const; + virtual void thread (PortableServer::ThreadPolicyValue value); - PortableServer::ThreadPolicyValue thread (void) const; - void thread (PortableServer::ThreadPolicyValue value); + virtual PortableServer::LifespanPolicyValue lifespan (void) const; + virtual void lifespan (PortableServer::LifespanPolicyValue value); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::IdUniquenessPolicyValue id_uniqueness (void) const; + virtual void id_uniqueness (PortableServer::IdUniquenessPolicyValue value); - PortableServer::LifespanPolicyValue lifespan (void) const; - void lifespan (PortableServer::LifespanPolicyValue value); + virtual PortableServer::IdAssignmentPolicyValue id_assignment (void) const; + virtual void id_assignment (PortableServer::IdAssignmentPolicyValue value); - PortableServer::IdUniquenessPolicyValue id_uniqueness (void) const; - void id_uniqueness (PortableServer::IdUniquenessPolicyValue value); + virtual PortableServer::ImplicitActivationPolicyValue implicit_activation (void) const; + virtual void implicit_activation (PortableServer::ImplicitActivationPolicyValue value); - PortableServer::IdAssignmentPolicyValue id_assignment (void) const; - void id_assignment (PortableServer::IdAssignmentPolicyValue value); + virtual PortableServer::ServantRetentionPolicyValue servant_retention (void) const; + virtual void servant_retention (PortableServer::ServantRetentionPolicyValue value); - PortableServer::ImplicitActivationPolicyValue implicit_activation (void) const; - void implicit_activation (PortableServer::ImplicitActivationPolicyValue value); + virtual PortableServer::RequestProcessingPolicyValue request_processing (void) const; + virtual void request_processing (PortableServer::RequestProcessingPolicyValue value); - PortableServer::ServantRetentionPolicyValue servant_retention (void) const; - void servant_retention (PortableServer::ServantRetentionPolicyValue value); + // ************************************************** + // + // TAO spcific POA locking policy (non-standard) + // + // ************************************************** - PortableServer::RequestProcessingPolicyValue request_processing (void) const; - void request_processing (PortableServer::RequestProcessingPolicyValue value); + virtual PortableServer::SynchronizationPolicyValue synchronization (void) const; + virtual void synchronization (PortableServer::SynchronizationPolicyValue value); - void parse_policies (const CORBA::PolicyList &policies, - CORBA_Environment &ACE_TRY_ENV); + virtual void parse_policies (const CORBA::PolicyList &policies, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); protected: - void parse_policy (const CORBA::Policy_ptr policy, - CORBA_Environment &ACE_TRY_ENV); + virtual void parse_policy (const CORBA::Policy_ptr policy, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - int validity_check (void); + virtual int validity_check (void); PortableServer::ThreadPolicyValue thread_; @@ -302,6 +311,14 @@ protected: PortableServer::ServantRetentionPolicyValue servant_retention_; PortableServer::RequestProcessingPolicyValue request_processing_; + + // ************************************************** + // + // TAO spcific POA locking policy (non-standard) + // + // ************************************************** + + PortableServer::SynchronizationPolicyValue synchronization_; }; class TAO_Temporary_Creation_Time; @@ -314,11 +331,11 @@ public: TAO_Creation_Time (void); - void creation_time (const void *creation_time); + virtual void creation_time (const void *creation_time); - const void *creation_time (void) const; + virtual const void *creation_time (void) const; - static CORBA::ULong creation_time_length (void); + static int creation_time_length (void); int operator== (const TAO_Creation_Time &rhs) const; @@ -348,7 +365,7 @@ public: TAO_Temporary_Creation_Time (void); - void creation_time (const void *creation_time); + virtual void creation_time (const void *creation_time); int operator== (const TAO_Creation_Time &rhs) const; @@ -359,128 +376,115 @@ protected: void *time_stamp_; }; -class TAO_POA_Current_Impl; +class TAO_POA_Current; class TAO_Export TAO_POA : public POA_PortableServer::POA { public: - friend class TAO_Object_Adapter; - friend class TAO_Object_Adapter::Outstanding_Requests; - friend class TAO_Object_Adapter::Single_Threaded_POA_Lock; - friend class TAO_POA_Current_Impl; - friend class TAO_POA_Manager; - typedef ACE_CString String; - PortableServer::POA_ptr create_POA (const char *adapter_name, - PortableServer::POAManager_ptr poa_manager, - const CORBA::PolicyList &policies, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - - PortableServer::POA_ptr find_POA (const char *adapter_name, - CORBA::Boolean activate_it, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - - void destroy (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - -#if !defined (TAO_HAS_MINIMUM_CORBA) - - PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::POA_ptr create_POA (const char *adapter_name, + PortableServer::POAManager_ptr poa_manager, + const CORBA::PolicyList &policies, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr find_POA (const char *adapter_name, + CORBA::Boolean activate_it, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void destroy (CORBA::Boolean etherealize_objects, + CORBA::Boolean wait_for_completion, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ThreadPolicy_ptr create_thread_policy (PortableServer::ThreadPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::LifespanPolicy_ptr create_lifespan_policy (PortableServer::LifespanPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (PortableServer::IdUniquenessPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (PortableServer::IdAssignmentPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ImplicitActivationPolicy_ptr create_implicit_activation_policy (PortableServer::ImplicitActivationPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual PortableServer::ServantRetentionPolicy_ptr create_servant_retention_policy (PortableServer::ServantRetentionPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::String the_name (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::RequestProcessingPolicy_ptr create_request_processing_policy (PortableServer::RequestProcessingPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::POA_ptr the_parent (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - - PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + // ************************************************** + // + // TAO spcific POA locking policy (non-standard) + // + // ************************************************** -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::SynchronizationPolicy_ptr create_synchronization_policy (PortableServer::SynchronizationPolicyValue value, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::String the_name (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void the_activator (PortableServer::AdapterActivator_ptr adapter_activator, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::POA_ptr the_parent (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ServantManager_ptr get_servant_manager (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::POAManager_ptr the_POAManager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void set_servant_manager (PortableServer::ServantManager_ptr imgr, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::AdapterActivator_ptr the_activator (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::Servant get_servant (CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void the_activator (PortableServer::AdapterActivator_ptr adapter_activator, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void set_servant (PortableServer::Servant servant, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ServantManager_ptr get_servant_manager (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual void set_servant_manager (PortableServer::ServantManager_ptr imgr, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::Servant get_servant (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void activate_object_with_id (const PortableServer::ObjectId &id, - PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void set_servant (PortableServer::Servant servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void deactivate_object (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr create_reference (const char *intf, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void activate_object_with_id (const PortableServer::ObjectId &id, + PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, - const char *intf, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); - PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual void deactivate_object (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Object_ptr create_reference (const char *intf, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Object_ptr create_reference_with_id (const PortableServer::ObjectId &oid, + const char *intf, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + virtual PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void forward_object (const PortableServer::ObjectId &oid, - CORBA::Object_ptr forward_to, - CORBA_Environment &ACE_TRY_ENV = CORBA::default_environment ()); + virtual CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual void forward_object (const PortableServer::ObjectId &oid, + CORBA::Object_ptr forward_to, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // Utility functions for the other static void encode_sequence_to_string (CORBA::String &str, @@ -488,9 +492,9 @@ public: static void decode_string_to_sequence (TAO_Unbounded_Sequence<CORBA::Octet> &seq, const char *str); - static char* ObjectId_to_string (const PortableServer::ObjectId &id); + static CORBA::String ObjectId_to_string (const PortableServer::ObjectId &id); - static CORBA::WChar* ObjectId_to_wstring (const PortableServer::ObjectId &id); + static CORBA::WString ObjectId_to_wstring (const PortableServer::ObjectId &id); static PortableServer::ObjectId *string_to_ObjectId (const char *id); @@ -499,134 +503,149 @@ public: static PortableServer::ObjectId *wstring_to_ObjectId (const CORBA::WChar *id); - TAO_POA (const String &name, + TAO_POA (const String &adapter_name, TAO_POA_Manager &poa_manager, const TAO_POA_Policies &policies, TAO_POA *parent, - ACE_Lock &lock, - ACE_SYNCH_MUTEX &thread_lock, - TAO_ORB_Core &orb_core, - CORBA_Environment &ACE_TRY_ENV); + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - ~TAO_POA (void); + virtual TAO_POA *clone (const String &adapter_name, + TAO_POA_Manager &poa_manager, + const TAO_POA_Policies &policies, + TAO_POA *parent, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - static char name_separator (void); + virtual ~TAO_POA (void); - static CORBA::ULong name_separator_length (void); + virtual void dispatch_servant (const TAO_ObjectKey &key, + CORBA::ServerRequest &req, + void *context, + TAO_ORB_Core *orb_core, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - enum - { - TAO_OBJECTKEY_PREFIX_SIZE = 4 - }; + virtual int locate_servant (const TAO_ObjectKey &key, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - static CORBA::Octet objectkey_prefix[TAO_OBJECTKEY_PREFIX_SIZE]; + virtual PortableServer::Servant find_servant (const TAO_ObjectKey &key, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - const TAO_Object_Adapter::poa_name &folded_name (void) const; + static char name_separator (void); - const TAO_Object_Adapter::poa_name &system_name (void) const; + static char id_separator (void); + + static CORBA::ULong name_separator_length (void); + + static CORBA::ULong id_separator_length (void); protected: - const ACE_CString &name (void) const; + virtual TAO_POA *create_POA (const String &adapter_name, + TAO_POA_Manager &poa_manager, + const TAO_POA_Policies &policies, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual TAO_POA *create_POA_i (const String &adapter_name, + TAO_POA_Manager &poa_manager, + const TAO_POA_Policies &policies, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA *create_POA (const String &adapter_name, - TAO_POA_Manager &poa_manager, - const TAO_POA_Policies &policies, - CORBA_Environment &ACE_TRY_ENV); + virtual TAO_POA *find_POA (const String &adapter_name, + CORBA::Boolean activate_it, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA *create_POA_i (const String &adapter_name, - TAO_POA_Manager &poa_manager, - const TAO_POA_Policies &policies, - CORBA_Environment &ACE_TRY_ENV); + virtual TAO_POA *find_POA_i (const String &adapter_name, + CORBA::Boolean activate_it, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA *find_POA_i (const ACE_CString &child_name, - CORBA::Boolean activate_it, - CORBA::Environment &ACE_TRY_ENV); + virtual TAO_POA *find_POA_i_optimized (const String &adapter_name, + CORBA::Boolean activate_it, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void destroy_i (CORBA::Boolean etherealize_objects, - CORBA::Boolean wait_for_completion, - CORBA_Environment &ACE_TRY_ENV); + virtual void destroy_i (CORBA::Boolean etherealize_objects, + CORBA::Boolean wait_for_completion, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual PortableServer::ServantManager_ptr get_servant_manager_i (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ServantManager_ptr get_servant_manager_i (CORBA_Environment &ACE_TRY_ENV); + virtual void set_servant_manager_i (PortableServer::ServantManager_ptr imgr, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void set_servant_manager_i (PortableServer::ServantManager_ptr imgr, - CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::Servant get_servant_i (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::Servant get_servant_i (CORBA_Environment &ACE_TRY_ENV); + virtual void set_servant_i (PortableServer::Servant servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void set_servant_i (PortableServer::Servant servant, - CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::ObjectId *activate_object_i (PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual void activate_object_with_id_i (const PortableServer::ObjectId &id, + PortableServer::Servant p_servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::ObjectId *activate_object_i (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV); + virtual void deactivate_object_i (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void activate_object_with_id_i (const PortableServer::ObjectId &id, - PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV); + virtual CORBA::Object_ptr create_reference_i (const char *intf, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void deactivate_all_objects_i (CORBA::Boolean etherealize_objects, - CORBA::Environment &ACE_TRY_ENV); + virtual PortableServer::ObjectId *servant_to_id_i (PortableServer::Servant servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void deactivate_object_i (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - void cleanup_servant (TAO_Active_Object_Map::Map_Entry *active_object_map_entry, - CORBA::Environment &ACE_TRY_ENV); + virtual CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr create_reference_i (const char *intf, - CORBA_Environment &ACE_TRY_ENV); + virtual void forward_object_i (const PortableServer::ObjectId &oid, + CORBA::Object_ptr forward_to, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr create_reference_with_id_i (const PortableServer::ObjectId &oid, - const char *intf, - CORBA_Environment &ACE_TRY_ENV); - PortableServer::ObjectId *servant_to_id_i (PortableServer::Servant servant, - CORBA_Environment &ACE_TRY_ENV); + virtual ACE_Lock &lock (void); - PortableServer::ObjectId *servant_to_system_id (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV); + virtual TAO_POA_Policies &policies (void); - PortableServer::ObjectId *servant_to_system_id_i (PortableServer::Servant p_servant, - CORBA_Environment &ACE_TRY_ENV); + virtual TAO_Active_Object_Map &active_object_map (void) const; - PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV); + virtual void delete_child (const String &child, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid, - CORBA_Environment &ACE_TRY_ENV); + virtual void delete_child_i (const String &child, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual String complete_name (void); - void forward_object_i (const PortableServer::ObjectId &oid, - CORBA::Object_ptr forward_to, - CORBA_Environment &ACE_TRY_ENV); + virtual void set_complete_name (void); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual int leaf_poa_name (const String &adapter_name, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - ACE_Lock &lock (void); + virtual void parse_poa_name (const TAO_POA::String &adapter_name, + TAO_POA::String &topmost_poa_name, + TAO_POA::String &tail_poa_name, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA_Policies &policies (void); + virtual PortableServer::ObjectId *create_object_id (PortableServer::Servant servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_Active_Object_Map &active_object_map (void) const; + virtual TAO_ObjectKey *create_object_key (const PortableServer::ObjectId &id); - int delete_child (const String &child); + virtual CORBA::ULong system_id_size (void) const; - void set_folded_name (void); + virtual int is_poa_generated_id (const PortableServer::ObjectId &id); - TAO_ObjectKey *create_object_key (const PortableServer::ObjectId &id); + virtual int is_poa_generated_key (const TAO_ObjectKey &key); - int is_poa_generated_id (const PortableServer::ObjectId &id); + virtual int parse_key (const TAO_ObjectKey &key, + String &poa_name, + PortableServer::ObjectId &id, + CORBA::Boolean &persistent, + CORBA::Boolean &system_id, + TAO_Temporary_Creation_Time &poa_creation_time); - 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_Temporary_Creation_Time &poa_creation_time); + virtual int rfind (const TAO_ObjectKey &key, + char c, + int pos = TAO_POA::String::npos) const; // Should really be protected, but some compilers complain public: @@ -639,20 +658,43 @@ public: }; protected: - LOCATION_RESULT locate_servant_i (const PortableServer::ObjectId &id, - PortableServer::Servant &servant, - CORBA_Environment &ACE_TRY_ENV); + virtual LOCATION_RESULT locate_servant_i (const TAO_ObjectKey &key, + PortableServer::Servant &servant, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - PortableServer::Servant locate_servant_i (const char *operation, - const PortableServer::ObjectId &id, - TAO_POA_Current_Impl *poa_current_impl, - CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::Servant locate_poa_and_servant_i (const TAO_ObjectKey &key, + const char *operation, + PortableServer::ObjectId &id, + TAO_POA *&poa_impl, + TAO_ORB_Core *orb_core, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - const TAO_Creation_Time &creation_time (void); + virtual TAO_POA *locate_poa_i (const TAO_ObjectKey &key, + PortableServer::ObjectId &id, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Boolean persistent (void); + virtual void dispatch_servant_i (const TAO_ObjectKey &key, + CORBA::ServerRequest &req, + void *context, + TAO_ORB_Core *orb_core, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - char persistent_key_type (void); + virtual void pre_invoke (const TAO_ObjectKey &key, + const PortableServer::ObjectId &id, + PortableServer::Servant servant, + TAO_POA_Current *poa_current, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual void post_invoke (PortableServer::Servant servant, + const char *operation, + TAO_POA_Current *poa_current, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual const TAO_Creation_Time &creation_time (void); + + virtual CORBA::Boolean persistent (void); + + virtual char persistent_key_type (void); static char persistent_key_char (void); @@ -660,9 +702,9 @@ protected: static CORBA::ULong persistent_key_type_length (void); - CORBA::Boolean system_id (void); + virtual CORBA::Boolean system_id (void); - char system_id_key_type (void); + virtual char system_id_key_type (void); static char system_id_key_char (void); @@ -670,33 +712,13 @@ protected: static CORBA::ULong system_id_key_type_length (void); - CORBA::Boolean root (void); - - char root_key_type (void); - - static char root_key_char (void); + virtual void create_internal_lock (void); - static char non_root_key_char (void); - - static CORBA::ULong root_key_type_length (void); - - CORBA::ULong outstanding_requests (void) const; - - void outstanding_requests (CORBA::ULong new_outstanding_requests); - - CORBA::ULong increment_outstanding_requests (void); - - CORBA::ULong decrement_outstanding_requests (void); - - void establish_servant_lock (PortableServer::Servant servant); - - void teardown_servant_lock (PortableServer::Servant servant); + virtual void create_active_object_map (void); String name_; - TAO_Object_Adapter::poa_name folded_name_; - - TAO_Object_Adapter::poa_name_var system_name_; + String complete_name_; TAO_POA_Manager &poa_manager_; @@ -708,202 +730,209 @@ protected: int delete_active_object_map_; -#if !defined (TAO_HAS_MINIMUM_CORBA) - PortableServer::AdapterActivator_var adapter_activator_; PortableServer::ServantActivator_var servant_activator_; PortableServer::ServantLocator_var servant_locator_; - PortableServer::ServantBase_var default_servant_; - -#endif /* TAO_HAS_MINIMUM_CORBA */ + PortableServer::Servant default_servant_; typedef ACE_Hash_Map_Manager<ACE_CString, TAO_POA *, ACE_Null_Mutex> - CHILDREN; + CHILDREN; CHILDREN children_; - ACE_Lock &lock_; + ACE_Lock *lock_; + + int closing_down_; int persistent_; int system_id_; TAO_Creation_Time creation_time_; +}; - TAO_ORB_Core &orb_core_; +class TAO_Export TAO_POA_Manager : public POA_PortableServer::POAManager +{ + friend class TAO_POA; - CORBA::Boolean cleanup_in_progress_; +public: + enum Processing_State + { + ACTIVE, + DISCARDING, + HOLDING, + INACTIVE, + UNKNOWN + }; - CORBA::Boolean etherealize_objects_; + virtual void activate (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::ULong outstanding_requests_; + virtual void hold_requests (CORBA::Boolean wait_for_completion, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - ACE_SYNCH_CONDITION outstanding_requests_condition_; + virtual void discard_requests (CORBA::Boolean wait_for_completion, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - CORBA::Boolean destroy_pending_; -}; + virtual void deactivate (CORBA::Boolean etherealize_objects, + CORBA::Boolean wait_for_completion, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -#if !defined (TAO_HAS_MINIMUM_CORBA) + TAO_POA_Manager (void); -class TAO_Export TAO_Adapter_Activator : public POA_PortableServer::AdapterActivator -{ -public: + virtual TAO_POA_Manager *clone (void); - CORBA::Boolean unknown_adapter (PortableServer::POA_ptr parent, - const char *name, - CORBA_Environment &ACE_TRY_ENV); -}; + virtual ~TAO_POA_Manager (void); -#endif /* TAO_HAS_MINIMUM_CORBA */ + virtual Processing_State state (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); -class TAO_Export TAO_POA_Current : public POA_PortableServer::Current -{ -public: +protected: - PortableServer::POA_ptr get_POA (CORBA_Environment &ACE_TRY_ENV); - // Returns the POA on which the current request is being invoked. - // Can raise the <CORBA::NoContext> exception if this function is - // not invoked in the context of an upcall. + virtual ACE_Lock &lock (void); - PortableServer::ObjectId *get_object_id (CORBA_Environment &ACE_TRY_ENV); - // Returns the object id of the current request being invoked. Can - // raise the <CORBA::NoContext> exception if this function is not - // invoked in the context of an upcall. + virtual void remove_poa (TAO_POA *poa, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA_Current_Impl *implementation (void); - // Returns the class that implements this interface. + virtual void remove_poa_i (TAO_POA *poa, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); - TAO_POA_Current_Impl *implementation (TAO_POA_Current_Impl *new_current); - // Sets the thread-specific pointer to the new POA Current state, - // returning a pointer to the existing POA Current state. + virtual void register_poa (TAO_POA *poa, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + virtual void register_poa_i (TAO_POA *poa, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); + + Processing_State state_; + + int closing_down_; + + ACE_Lock *lock_; + + typedef ACE_Unbounded_Set<TAO_POA *> POA_COLLECTION; + + POA_COLLECTION poa_collection_; }; -class TAO_Export TAO_POA_Current_Impl +class TAO_Export TAO_Adapter_Activator : public POA_PortableServer::AdapterActivator +{ +public: + + virtual CORBA::Boolean unknown_adapter (PortableServer::POA_ptr parent, + const char *name, + CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); +}; + +class TAO_Export TAO_POA_Current : public POA_PortableServer::Current { // = TITLE // - // Implementation of the PortableServer::Current object. + // Implementation of the PortableServer::Current object. // // = DESCRIPTION // - // Objects of this class hold state information regarding the - // current POA invocation. Savvy readers will notice that this - // contains substantially more methods than the POA spec shows; - // they exist because the ORB either (a) needs them or (b) finds - // them useful for implementing a more efficient ORB. + // Objects of this class hold state information regarding the + // current POA invocation. Savvy readers will notice that this + // contains substantially more methods than the POA spec shows; they + // exist because the ORB either (a) needs them or (b) finds them + // useful for implementing a more efficient ORB. // - // The intent is that instances of this class are held in - // Thread-Specific Storage so that upcalls can get context - // information regarding their invocation. The POA itself must - // insure that all <set_*> operations are performed in the - // execution thread so that the proper <TAO_POA_Current> pointer - // is obtained from TSS. + // The intent is that instances of this class are held in + // Thread-Specific Storage so that upcalls can get context + // information regarding their invocation. The POA itself must + // insure that all <set_*> operations are performed in the execution + // thread so that the proper <TAO_POA_Current> pointer is obtained + // from TSS. public: + // = Specification-mandated methods - friend class TAO_POA; - - PortableServer::POA_ptr get_POA (CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::POA_ptr get_POA (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // Return pointer to the invoking POA. Raises the // <CORBA::NoContext> exception. - PortableServer::ObjectId *get_object_id (CORBA_Environment &ACE_TRY_ENV); + virtual PortableServer::ObjectId *get_object_id (CORBA_Environment &TAO_IN_ENV = CORBA::default_environment ()); // Return pointer to the object id through which this was invoked. // This may be necessary in cases where a <Servant> is serving under // the guise of multiple object ids. This has _out semantics Raises // the <CORBA::NoContext> exception. - void POA_impl (TAO_POA *impl); + // = TAO Extensions + + virtual void clear (void); + // Clear any prior settings made. This will make things which can + // throw the <CORBA::NoContext> exception raise it if invoked + // without a corresponding <set_*> operation. + + virtual int context_is_valid (void); + // Returns non-zero if the context is valid, i.e., if it would be + // impossible for a <CORBA::NoContext> exception to be raised. + + virtual void POA_impl (TAO_POA *impl); // Set the POA implementation. - TAO_POA *POA_impl (void) const; + virtual TAO_POA *POA_impl (void) const; // Get the POA imeplemantation - void object_id (const PortableServer::ObjectId &id); + virtual void object_id (const PortableServer::ObjectId &id); // Set the object ID. - const PortableServer::ObjectId &object_id (void) const; + virtual const PortableServer::ObjectId &object_id (void) const; // Get the object ID. - void object_key (const TAO_ObjectKey &key); + virtual void object_key (const TAO_ObjectKey &key); // Set the object key. - const TAO_ObjectKey &object_key (void) const; + virtual const TAO_ObjectKey &object_key (void) const; // Get the object key. - void servant (PortableServer::Servant servant); + virtual void servant (PortableServer::Servant servant); // Set the servant for the current upcall. - PortableServer::Servant servant (void) const; + virtual PortableServer::Servant servant (void) const; // Get the servant for the current upcall. -#if !defined (TAO_HAS_MINIMUM_CORBA) + virtual int in_upcall (void) const; + // Get whether we're in an upcall (non-zero is yes). - PortableServer::ServantLocator::Cookie locator_cookie (void) const; + virtual PortableServer::ServantLocator::Cookie locator_cookie (void) const; // Get the Servant Locator's cookie - void locator_cookie (PortableServer::ServantLocator::Cookie cookie); + virtual void locator_cookie (PortableServer::ServantLocator::Cookie cookie); // Set the Servant Locator's cookie -#endif /* TAO_HAS_MINIMUM_CORBA */ - - void active_object_map_entry (TAO_Active_Object_Map::Map_Entry *entry); - // Set the <active_object_map_entry>. - - TAO_Active_Object_Map::Map_Entry *active_object_map_entry (void) const; - // Get the <active_object_map_entry>. + TAO_POA_Current (void); + // Constructor - TAO_POA_Current_Impl (TAO_POA *impl, - const TAO_ObjectKey &key, - PortableServer::Servant servant, - const char *operation, - TAO_ORB_Core &orb_core); + TAO_POA_Current (TAO_POA *impl, + const TAO_ObjectKey &key, + const PortableServer::ObjectId &id, + PortableServer::Servant servant); // Convenience constructor combining construction & initialization. - ~TAO_POA_Current_Impl (void); + virtual ~TAO_POA_Current (void); // Destructor protected: TAO_POA *poa_impl_; // The POA implementation invoking an upcall - PortableServer::ObjectId object_id_; - // The object ID of the current context. This is the user id and - // not the id the goes into the IOR. Note also that unlike the - // <object_key>, this field is stored by value. + const PortableServer::ObjectId *object_id_; + // The object ID of the current context. const TAO_ObjectKey *object_key_; // The object key of the current context. -#if !defined (TAO_HAS_MINIMUM_CORBA) - PortableServer::ServantLocator::Cookie cookie_; // Servant Locator's cookie -#endif /* TAO_HAS_MINIMUM_CORBA */ - PortableServer::Servant servant_; // The servant for the current upcall. - const char *operation_; - // Operation name for this current. - - TAO_ORB_Core *orb_core_; - // ORB Core for this current. - - TAO_POA_Current_Impl *previous_current_impl_; - // Current previous from <this>. - - TAO_Active_Object_Map::Map_Entry *active_object_map_entry_; - // Pointer to the entry in the TAO_Active_Object_Map corresponding - // to the servant for this request. - // = Hidden because we don't allow these - TAO_POA_Current_Impl (const TAO_POA_Current_Impl &); - void operator= (const TAO_POA_Current_Impl &); + TAO_POA_Current (const TAO_POA_Current &); + void operator= (const TAO_POA_Current &); }; #if defined (__ACE_INLINE__) |