diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-22 00:06:22 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-01-22 00:06:22 +0000 |
commit | 88b3d1ee6612d04014917a881d94b93cb803eb18 (patch) | |
tree | e8c6a5a9a547791dffbc5ff06f511a9644fafb4f | |
parent | 461263cdb96da7f4d18676b5bf0791edaef4e9c5 (diff) | |
download | ATCD-88b3d1ee6612d04014917a881d94b93cb803eb18.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/TAO.dsp | 8 | ||||
-rw-r--r-- | TAO/tao/default_server.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/poa.cpp | 287 | ||||
-rw-r--r-- | TAO/tao/poa.h | 55 | ||||
-rw-r--r-- | TAO/tao/poaC.cpp | 25 | ||||
-rw-r--r-- | TAO/tao/poaC.h | 5 | ||||
-rw-r--r-- | TAO/tao/poaS.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/poaS.h | 12 | ||||
-rw-r--r-- | TAO/tao/servant_base.cpp | 10 |
9 files changed, 244 insertions, 164 deletions
diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 2ea42aaa9a6..3c75a9c452b 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -208,6 +208,14 @@ SOURCE=.\poa.cpp # End Source File
# Begin Source File
+SOURCE=.\poaC.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\poaS.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\principa.cpp
# End Source File
# Begin Source File
diff --git a/TAO/tao/default_server.cpp b/TAO/tao/default_server.cpp index 5431223ee07..71ed06e3e83 100644 --- a/TAO/tao/default_server.cpp +++ b/TAO/tao/default_server.cpp @@ -91,7 +91,7 @@ TAO_Default_Server_Strategy_Factory::create_poa_lock (void) { case TAO_THREAD_LOCK: ACE_NEW_RETURN (thelock, - ACE_Lock_Adapter<ACE_Thread_Mutex> (), + ACE_Lock_Adapter<ACE_Recursive_Thread_Mutex> (), 0); break; case TAO_NULL_LOCK: diff --git a/TAO/tao/poa.cpp b/TAO/tao/poa.cpp index 885f8527bc0..23e9fabcbaa 100644 --- a/TAO/tao/poa.cpp +++ b/TAO/tao/poa.cpp @@ -520,6 +520,9 @@ TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, counter_ (0) { this->set_complete_name (); + + // Register self with manager + this->poa_manager_.register_poa (this, env); } TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, @@ -544,6 +547,9 @@ TAO_POA::TAO_POA (const TAO_POA::String &adapter_name, counter_ (0) { this->set_complete_name (); + + // Register self with manager + this->poa_manager_.register_poa (this, env); } TAO_POA * @@ -580,6 +586,14 @@ TAO_POA::~TAO_POA (void) { if (this->delete_active_object_table_) delete active_object_table_; + + // Remove POA from the POAManager + // + // Note: Errors are ignored here since there is nothing we can do + // about them + // + CORBA::Environment env; + this->poa_manager_.remove_poa (this, env); } ACE_Lock & @@ -622,7 +636,6 @@ TAO_POA::create_POA (const char *adapter_name, CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); return PortableServer::POA::_nil (); - } poa_manager_impl = ACE_dynamic_cast (TAO_POA_Manager *, servant); @@ -670,12 +683,16 @@ TAO_POA::create_POA_i (const TAO_POA::String &adapter_name, int result = this->children_.find (adapter_name); // Child was found - if (result == 0) + if (result != -1) { CORBA::Exception *exception = new PortableServer::POA::AdapterAlreadyExists; env.exception (exception); return 0; } + + // + // Child was not found + // // The specified policy objects are associated with the POA and used // to control its behavior. The policy objects are effectively @@ -710,13 +727,6 @@ TAO_POA::create_POA_i (const TAO_POA::String &adapter_name, // initialized, the application can initialize the POA by invoking // find_POA with a TRUE activate parameter. - this->poa_manager_.register_poa (new_poa.get (), env); - if (env.exception () != 0) - { - // @@ Remove new POA from parent list - return 0; - } - // Everything is fine // Don't let the auto_ptr delete the implementation return new_poa.release (); @@ -735,11 +745,24 @@ TAO_POA::create_POA_i (const TAO_POA::String &adapter_name, if (env.exception () != 0) return 0; + // If we are the topmost poa, let's create the tail + if (topmost_poa_name == this->name_) + { + return this->create_POA_i (tail_poa_name, + poa_manager, + policies, + env); + } + + // + // We are not the topmost POA + // + // Try to find the topmost child TAO_POA *child_poa = 0; int result = this->children_.find (topmost_poa_name, child_poa); - // Child was not found + // Child was not found or the topmost is us if (result != 0) { child_poa = this->create_POA_i (topmost_poa_name, @@ -821,35 +844,44 @@ TAO_POA::find_POA_i_optimized (const TAO_POA::String &adapter_name, // is returned. TAO_POA *child_poa = 0; int result = this->children_.find (adapter_name, child_poa); + + // Child was found + if (result != -1) + return child_poa; + // // Child was not found - if (result != 0) + // + + // If a child POA with the specified name does not exist and the + // value of the activate_it parameter is TRUE, the target POA's + // AdapterActivator, if one exists, is invoked, and, if it + // successfully activates the child POA, that child POA is + // returned. + if (activate_it && !CORBA::is_nil (this->adapter_activator_)) { - // If a child POA with the specified name does not exist and - // the value of the activate_it parameter is TRUE, the - // target POA's AdapterActivator, if one exists, is invoked, - // and, if it successfully activates the child POA, that - // child POA is returned. - if (activate_it && !CORBA::is_nil (this->the_activator (env))) + PortableServer::POA_var self = this->_this (env); + // Check for exceptions + if (env.exception () != 0) + return 0; + + CORBA::Boolean success = + this->adapter_activator_->unknown_adapter (self.in (), + adapter_name.c_str (), + env); + // Check for exceptions + if (env.exception () != 0) + return 0; + + // On success + if (success) { - CORBA::Boolean success = - this->the_activator (env)->unknown_adapter (this->_this (env), - adapter_name.c_str (), - env); - // Check for exceptions - if (env.exception () != 0) - return 0; - - // On success - if (success) - { - // Search the children table again - result = this->children_.find (adapter_name, child_poa); - - // Child was found - if (result == 0) - return child_poa; - } + // Search the children table again + result = this->children_.find (adapter_name, child_poa); + + // Child was found + if (result != -1) + return child_poa; } } @@ -873,9 +905,21 @@ TAO_POA::find_POA_i_optimized (const TAO_POA::String &adapter_name, if (env.exception () != 0) return 0; + // If we are the topmost poa, let's create the tail + if (topmost_poa_name == this->name_) + { + return this->find_POA_i (tail_poa_name, + activate_it, + env); + } + + // + // We are not the topmost POA + // + // Try to find the topmost child TAO_POA *child_poa; - int result = this->children_.find (adapter_name, child_poa); + int result = this->children_.find (topmost_poa_name, child_poa); // Child was not found if (result != 0) @@ -922,20 +966,15 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, // re-creation of its associated POA in the same process.) // Remove POA from the parent - this->parent_->delete_child (this->name_, env); - - if (env.exception () != 0) - return; - - // Remove POA from the POAManager - this->poa_manager_.remove_poa (this, env); + if (this->parent_ != 0) + this->parent_->delete_child (this->name_, env); if (env.exception () != 0) return; // Remove all children POAs for (CHILDREN::iterator iterator = this->children_.begin (); - iterator != this->children_.end () && env.exception () != 0; + iterator != this->children_.end () && env.exception () == 0; iterator++) { TAO_POA *child_poa = (*iterator).int_id_; @@ -970,11 +1009,15 @@ TAO_POA::destroy_i (CORBA::Boolean etherealize_objects, !CORBA::is_nil (this->servant_activator_)) { for (TAO_Object_Table::iterator iterator = this->active_object_table ().begin (); - iterator != this->active_object_table ().end () && env.exception () != 0; + iterator != this->active_object_table ().end () && env.exception () == 0; iterator++) { + PortableServer::POA_var self = this->_this (env); + if (env.exception () != 0) + return; + this->servant_activator_->etherealize ((*iterator).ext_id_, - this->_this (env), + self.in (), (*iterator).int_id_, CORBA::B_TRUE, CORBA::B_FALSE, @@ -999,27 +1042,27 @@ void TAO_POA::delete_child (const TAO_POA::String &child, CORBA::Environment &env) { - // No locks are necessary if we are closing down - if (this->closing_down_) - { - this->delete_child_i (child, - env); - } - else - { + // If we are not closing down, we must remove this child from our + // collection. + if (!this->closing_down_) + { // Lock access to the POA for the duration of this transaction TAO_POA_WRITE_GUARD (ACE_Lock, monitor, this->lock (), env); this->delete_child_i (child, env); } + + // If we are closing down, we are currently iterating over our + // children and there is not need to remove this child from our + // collection. } void TAO_POA::delete_child_i (const TAO_POA::String &child, CORBA::Environment &env) { - if (this->children_.unbind (child) == 0) + if (this->children_.unbind (child) != 0) { CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); env.exception (exception); @@ -1365,9 +1408,13 @@ TAO_POA::deactivate_object_i (const PortableServer::ObjectId& oid, // deactivated. It is the responsibility of the object // implementation to refrain from destroying the servant while it is // active with any Id. + PortableServer::POA_var self = this->_this (env); + if (env.exception () != 0) + return; + if (!CORBA::is_nil (this->servant_activator_)) this->servant_activator_->etherealize (oid, - this->_this (env), + self.in (), servant, 0, CORBA::B_FALSE, @@ -1696,7 +1743,10 @@ TAO_POA::id_to_reference (const PortableServer::ObjectId &oid, PortableServer::POA_ptr TAO_POA::the_parent (CORBA::Environment &env) { - return this->parent_->_this (env); + if (this->parent_ != 0) + return this->parent_->_this (env); + else + return PortableServer::POA::_nil (); } PortableServer::POAManager_ptr @@ -1806,7 +1856,10 @@ TAO_POA::parse_key (const TAO::ObjectKey &key, // Take the substring from 0 to first_token_position for the // object_key_type. - TAO_POA::String object_key_type = object_key.substr (0, first_token_position); + int starting_at = 0; + int now_many = first_token_position - starting_at; + TAO_POA::String object_key_type = object_key.substr (starting_at, + now_many); if (object_key_type == this->persistent_key_type ()) persistent = 1; else if (object_key_type == this->transient_key_type ()) @@ -1817,14 +1870,18 @@ TAO_POA::parse_key (const TAO::ObjectKey &key, // Take the substring from (first_token_position + separator_length) // to second_token_position for the POA name - poa_name = object_key.substr (first_token_position + TAO_POA::name_separator_length (), - second_token_position); + starting_at = first_token_position + TAO_POA::name_separator_length (); + now_many = second_token_position - starting_at; + poa_name = object_key.substr (starting_at, + now_many); // Take the substring from (second_token_position + // separator_length) to length for the objectId - TAO_POA::String objectId = object_key.substr (second_token_position + TAO_POA::name_separator_length (), - object_key.length ()); + starting_at = second_token_position + TAO_POA::name_separator_length (); + now_many = object_key.length () - starting_at; + TAO_POA::String objectId = object_key.substr (starting_at, + now_many); id = TAO_POA::string_to_ObjectId (objectId.c_str ()); @@ -1835,7 +1892,7 @@ TAO_POA::parse_key (const TAO::ObjectKey &key, CORBA::Boolean TAO_POA::persistent (void) { - return this->policies ().lifespan () == PortableServer::TRANSIENT; + return this->policies ().lifespan () == PortableServer::PERSISTENT; } const TAO_POA::String & @@ -1995,25 +2052,17 @@ TAO_POA::parse_poa_name (const TAO_POA::String &adapter_name, else { // If found, take the substring from 0 to token_position - topmost_poa_name = adapter_name.substr (0, token_position); - } + int starting_at = 0; + int now_many = token_position - starting_at; + topmost_poa_name = adapter_name.substr (starting_at, + now_many); - // Try to find the name separator - token_position = adapter_name.rfind (TAO_POA::name_separator ()); - - // If not found, the name was a leaf, throw exception - if (token_position == TAO_POA::String::npos) - { - CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); - env.exception (exception); - return; - } - else - { - // If found, take the substring from (token_position + - // separator_length) to length - tail_poa_name = adapter_name.substr (token_position + TAO_POA::name_separator_length (), - adapter_name.length ()); + // Take the substring from (token_position + separator_length) + // to length + starting_at = token_position + TAO_POA::name_separator_length (); + now_many = adapter_name.length () - starting_at; + tail_poa_name = adapter_name.substr (starting_at, + now_many); } } @@ -2279,42 +2328,41 @@ TAO_Adapter_Activator::unknown_adapter (PortableServer::POA_ptr parent, const char *name, CORBA::Environment &env) { - PortableServer::Servant servant = parent->_servant (); - if (servant == 0) - { - CORBA::Exception *exception = new CORBA::OBJ_ADAPTER (CORBA::COMPLETED_NO); - env.exception (exception); - return CORBA::B_FALSE; - } - - TAO_POA *parent_impl = ACE_dynamic_cast (TAO_POA *, servant); + // Default policies + PortableServer::PolicyList default_policies; - return this->unknown_adapter_i (parent_impl, - name, - env); -} - -CORBA::Boolean -TAO_Adapter_Activator::unknown_adapter_i (TAO_POA *parent, - const TAO_POA::String &name, - CORBA::Environment &env) -{ - // Use default policies - TAO_POA_Policies default_policies; - - // New poa manager - TAO_POA_Manager *poa_manager = parent->poa_manager_.clone (); - - // This assumes that the lock on the parent is already held - parent->create_POA_i (name, - *poa_manager, - default_policies, - env); + // This assumes that the lock on the parent is recursive + PortableServer::POA_var child = parent->create_POA (name, + PortableServer::POAManager::_nil (), + default_policies, + env); if (env.exception () != 0) return CORBA::B_FALSE; else - return CORBA::B_TRUE; + { + PortableServer::AdapterActivator_var activator = this->_this (env); + if (env.exception () != 0) + { + child->destroy (CORBA::B_FALSE, + CORBA::B_FALSE, + env); + return CORBA::B_FALSE; + } + + child->the_activator (activator, env); + + if (env.exception () != 0) + { + child->destroy (CORBA::B_FALSE, + CORBA::B_FALSE, + env); + return CORBA::B_FALSE; + } + + // Finally everything is fine + return CORBA::B_TRUE; + } } TAO_POA_Manager::TAO_POA_Manager (void) @@ -2458,7 +2506,7 @@ TAO_POA_Manager::deactivate (CORBA::Boolean etherealize_objects, // crisis (for example, unrecoverable error) situation. for (POA_COLLECTION::iterator iterator = this->poa_collection_.begin (); - iterator != this->poa_collection_.end () && env.exception () != 0; + iterator != this->poa_collection_.end () && env.exception () == 0; iterator++) { TAO_POA *poa = *iterator; @@ -2497,19 +2545,20 @@ void TAO_POA_Manager::remove_poa (TAO_POA *poa, CORBA::Environment &env) { - if (this->closing_down_) + // If we are not closing down, we must remove this poa from our + // collection. + if (!this->closing_down_) { - this->remove_poa_i (poa, - env); - } - else - { // Lock access to the POAManager for the duration of this transaction TAO_POA_WRITE_GUARD (ACE_Lock, monitor, this->lock (), env); this->remove_poa_i (poa, env); } + + // If we are closing down, we are currently iterating over our poa + // collection and there is not need to remove this poa from our + // collection. } void diff --git a/TAO/tao/poa.h b/TAO/tao/poa.h index e9e62f2a6cc..5860281bf93 100644 --- a/TAO/tao/poa.h +++ b/TAO/tao/poa.h @@ -52,7 +52,7 @@ class TAO_POA; class TAO_POA_Manager; -class TAO_Thread_Policy : public POA_PortableServer::ThreadPolicy +class TAO_Export TAO_Thread_Policy : public POA_PortableServer::ThreadPolicy { public: TAO_Thread_Policy (PortableServer::ThreadPolicyValue value); @@ -69,7 +69,7 @@ protected: PortableServer::ThreadPolicyValue value_; }; -class TAO_Lifespan_Policy : public POA_PortableServer::LifespanPolicy +class TAO_Export TAO_Lifespan_Policy : public POA_PortableServer::LifespanPolicy { public: TAO_Lifespan_Policy (PortableServer::LifespanPolicyValue value); @@ -86,7 +86,7 @@ protected: PortableServer::LifespanPolicyValue value_; }; -class TAO_Id_Uniqueness_Policy : public POA_PortableServer::IdUniquenessPolicy +class TAO_Export TAO_Id_Uniqueness_Policy : public POA_PortableServer::IdUniquenessPolicy { public: TAO_Id_Uniqueness_Policy (PortableServer::IdUniquenessPolicyValue value); @@ -103,7 +103,7 @@ protected: PortableServer::IdUniquenessPolicyValue value_; }; -class TAO_Id_Assignment_Policy : public POA_PortableServer::IdAssignmentPolicy +class TAO_Export TAO_Id_Assignment_Policy : public POA_PortableServer::IdAssignmentPolicy { public: TAO_Id_Assignment_Policy (PortableServer::IdAssignmentPolicyValue value); @@ -120,7 +120,7 @@ protected: PortableServer::IdAssignmentPolicyValue value_; }; -class TAO_Implicit_Activation_Policy : public POA_PortableServer::ImplicitActivationPolicy +class TAO_Export TAO_Implicit_Activation_Policy : public POA_PortableServer::ImplicitActivationPolicy { public: TAO_Implicit_Activation_Policy (PortableServer::ImplicitActivationPolicyValue value); @@ -137,7 +137,7 @@ protected: PortableServer::ImplicitActivationPolicyValue value_; }; -class TAO_Servant_Retention_Policy : public POA_PortableServer::ServantRetentionPolicy +class TAO_Export TAO_Servant_Retention_Policy : public POA_PortableServer::ServantRetentionPolicy { public: TAO_Servant_Retention_Policy (PortableServer::ServantRetentionPolicyValue value); @@ -154,7 +154,7 @@ protected: PortableServer::ServantRetentionPolicyValue value_; }; -class TAO_Request_Processing_Policy : public POA_PortableServer::RequestProcessingPolicy +class TAO_Export TAO_Request_Processing_Policy : public POA_PortableServer::RequestProcessingPolicy { public: TAO_Request_Processing_Policy (PortableServer::RequestProcessingPolicyValue value); @@ -171,7 +171,7 @@ protected: PortableServer::RequestProcessingPolicyValue value_; }; -class TAO_POA_Policies +class TAO_Export TAO_POA_Policies { public: @@ -221,10 +221,8 @@ protected: PortableServer::RequestProcessingPolicyValue request_processing_; }; -class TAO_POA : public POA_PortableServer::POA +class TAO_Export TAO_POA : public POA_PortableServer::POA { - friend class TAO_Adapter_Activator; - public: typedef ACE_CString String; @@ -363,6 +361,14 @@ public: virtual PortableServer::Servant locate_servant (const TAO::ObjectKey &key, CORBA::Environment &env); + static char name_separator (void); + + static char id_separator (void); + + static CORBA::ULong name_separator_length (void); + + static CORBA::ULong id_separator_length (void); + protected: virtual PortableServer::Servant locate_servant_i (const TAO::ObjectKey &key, @@ -460,7 +466,7 @@ protected: PortableServer::ObjectId_out id, CORBA::Boolean &persistent); - virtual CORBA::Boolean persistent (void); + virtual CORBA::Boolean persistent (void); virtual const String &object_key_type (void); @@ -474,14 +480,6 @@ protected: static const char *ObjectKey_to_const_string (const TAO::ObjectKey &key); - static char name_separator (void); - - static char id_separator (void); - - static CORBA::ULong name_separator_length (void); - - static CORBA::ULong id_separator_length (void); - String name_; String complete_name_; @@ -515,10 +513,9 @@ protected: CORBA::ULong counter_; }; -class TAO_POA_Manager : public POA_PortableServer::POAManager +class TAO_Export TAO_POA_Manager : public POA_PortableServer::POAManager { friend class TAO_POA; - friend class TAO_Adapter_Activator; public: enum Processing_State @@ -577,22 +574,16 @@ protected: POA_COLLECTION poa_collection_; }; -class TAO_Adapter_Activator : public POA_PortableServer::AdapterActivator +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 &env); - -protected: - - virtual CORBA::Boolean unknown_adapter_i (TAO_POA *parent, - const TAO_POA::String &name, - CORBA::Environment &env); }; -class TAO_Strategy_POA : public TAO_POA +class TAO_Export TAO_Strategy_POA : public TAO_POA { public: @@ -633,7 +624,7 @@ protected: typedef TAO_Strategy_POA SELF; }; -class TAO_Strategy_POA_Manager : public TAO_POA_Manager +class TAO_Export TAO_Strategy_POA_Manager : public TAO_POA_Manager { public: @@ -652,7 +643,7 @@ protected: typedef TAO_Strategy_POA_Manager SELF; }; -class TAO_POA_Current : public POA_PortableServer::Current +class TAO_Export TAO_POA_Current : public POA_PortableServer::Current { // = TITLE // diff --git a/TAO/tao/poaC.cpp b/TAO/tao/poaC.cpp index 037a7790d54..bee32caef92 100644 --- a/TAO/tao/poaC.cpp +++ b/TAO/tao/poaC.cpp @@ -2912,3 +2912,28 @@ static const CORBA::Long _oc_PortableServer_Current[] = static CORBA::TypeCode _tc__tc_PortableServer_Current (CORBA::tk_objref, sizeof (_oc_PortableServer_Current), (unsigned char *) &_oc_PortableServer_Current, CORBA::B_FALSE); CORBA::TypeCode_ptr PortableServer::_tc_Current = &_tc__tc_PortableServer_Current; +char * +PortableServer::ObjectId_to_string (const PortableServer::ObjectId &id) +{ + return TAO_POA::ObjectId_to_string (id); +} + +wchar_t * +PortableServer::ObjectId_to_wstring (const PortableServer::ObjectId &id) +{ + return TAO_POA::ObjectId_to_wstring (id); +} + +PortableServer::ObjectId * +PortableServer::string_to_ObjectId (const char *id) +{ + return TAO_POA::string_to_ObjectId (id); +} + +PortableServer::ObjectId * +PortableServer::wstring_to_ObjectId (const wchar_t *id) +{ + return TAO_POA::wstring_to_ObjectId (id); +} + + diff --git a/TAO/tao/poaC.h b/TAO/tao/poaC.h index 1bd271a90b1..8fa3bfef643 100644 --- a/TAO/tao/poaC.h +++ b/TAO/tao/poaC.h @@ -2312,6 +2312,11 @@ class Current; static CORBA::TypeCode_ptr _tc_Current; + static char *ObjectId_to_string (const PortableServer::ObjectId &id); + static wchar_t *ObjectId_to_wstring (const PortableServer::ObjectId &id); + static PortableServer::ObjectId *string_to_ObjectId (const char *id); + static PortableServer::ObjectId *wstring_to_ObjectId (const wchar_t *id); + }; diff --git a/TAO/tao/poaS.cpp b/TAO/tao/poaS.cpp index 39b557bb83d..f912e4509d0 100644 --- a/TAO/tao/poaS.cpp +++ b/TAO/tao/poaS.cpp @@ -2988,7 +2988,7 @@ void POA_PortableServer::_tao_collocated_POA::deactivate_object ( } CORBA::Object_ptr POA_PortableServer::_tao_collocated_POA::create_reference ( - const PortableServer::RepositoryId intf, + const char *intf, CORBA::Environment &_tao_environment ) { @@ -3000,7 +3000,7 @@ CORBA::Object_ptr POA_PortableServer::_tao_collocated_POA::create_reference ( CORBA::Object_ptr POA_PortableServer::_tao_collocated_POA::create_reference_with_id ( const PortableServer::ObjectId & oid, - const PortableServer::RepositoryId intf, + const char *intf, CORBA::Environment &_tao_environment ) { diff --git a/TAO/tao/poaS.h b/TAO/tao/poaS.h index 31ce477b300..04039d91b7c 100644 --- a/TAO/tao/poaS.h +++ b/TAO/tao/poaS.h @@ -602,7 +602,7 @@ public: class AdapterActivator; typedef AdapterActivator *AdapterActivator_ptr; - class AdapterActivator : public virtual PortableServer::LocalServantBase + class TAO_Export AdapterActivator : public virtual PortableServer::LocalServantBase { protected: AdapterActivator (void); @@ -657,7 +657,7 @@ public: class ServantManager; typedef ServantManager *ServantManager_ptr; - class ServantManager : public virtual PortableServer::LocalServantBase + class TAO_Export ServantManager : public virtual PortableServer::LocalServantBase { protected: ServantManager (void); @@ -704,7 +704,7 @@ public: class ServantActivator; typedef ServantActivator *ServantActivator_ptr; - class ServantActivator : public virtual ServantManager + class TAO_Export ServantActivator : public virtual ServantManager { protected: ServantActivator (void); @@ -771,7 +771,7 @@ public: class ServantLocator; typedef ServantLocator *ServantLocator_ptr; - class ServantLocator : public virtual ServantManager + class TAO_Export ServantLocator : public virtual ServantManager { protected: ServantLocator (void); @@ -1053,12 +1053,12 @@ public: CORBA::Environment &_tao_environment ); virtual CORBA::Object_ptr create_reference ( - const PortableServer::RepositoryId intf, + const char *intf, CORBA::Environment &_tao_environment ); virtual CORBA::Object_ptr create_reference_with_id ( const PortableServer::ObjectId & oid, - const PortableServer::RepositoryId intf, + const char *intf, CORBA::Environment &_tao_environment ); virtual PortableServer::ObjectId * servant_to_id ( diff --git a/TAO/tao/servant_base.cpp b/TAO/tao/servant_base.cpp index d1431c84c90..ad360bb1d6b 100644 --- a/TAO/tao/servant_base.cpp +++ b/TAO/tao/servant_base.cpp @@ -21,10 +21,12 @@ TAO_ServantBase::~TAO_ServantBase (void) PortableServer::POA_ptr TAO_ServantBase::_default_POA (CORBA::Environment &env) { - CORBA_Object_ptr root_poa = - TAO_ORB_Core_instance ()->orb ()->resolve_initial_references ("RootPOA"); - - return PortableServer::POA::_narrow (root_poa, env); + TAO_POA *poa = TAO_ORB_Core_instance ()->root_poa (); + PortableServer::POA_var result = poa->_this (env); + if (env.exception () != 0) + return PortableServer::POA::_nil (); + else + return result._retn (); } CORBA::Boolean |