diff options
author | Phil Mesnier <mesnier_p@ociweb.com> | 2013-05-13 19:18:55 +0000 |
---|---|---|
committer | Phil Mesnier <mesnier_p@ociweb.com> | 2013-05-13 19:18:55 +0000 |
commit | 45efc2bb3b513ce4ccb2a2f1681eb8d1c3fe9451 (patch) | |
tree | 53951f08da3103faf4bb011b0f35e89dbc60cede | |
parent | f98710a6acc56ca9ace325d4b9ac2db9857e745f (diff) | |
download | ATCD-45efc2bb3b513ce4ccb2a2f1681eb8d1c3fe9451.tar.gz |
Mon May 13 19:12:59 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com>
-rw-r--r-- | TAO/ChangeLog | 148 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp | 148 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h | 40 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp | 278 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h | 107 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp | 126 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Iterator.cpp | 31 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Iterator.h | 26 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | 124 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.h | 34 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl | 2 | ||||
-rwxr-xr-x | TAO/orbsvcs/tests/ImplRepo/servers_list/run_test.pl | 5 | ||||
-rw-r--r-- | TAO/tao/Intrusive_Ref_Count_Handle_T.h | 4 | ||||
-rw-r--r-- | TAO/tao/Intrusive_Ref_Count_Handle_T.inl | 9 |
16 files changed, 656 insertions, 429 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index a16bdcc49c1..a2070102865 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,151 @@ +Mon May 13 19:12:59 UTC 2013 Phil Mesnier <mesnier_p@ociweb.com> + + * .: + * TAO_IDL: + + * orbsvcs/ImplRepo_Service/AsyncAccessManager.h: + * orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp: + * orbsvcs/ImplRepo_Service/AsyncListManager.h: + * orbsvcs/ImplRepo_Service/AsyncListManager.cpp: + * orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp: + * orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc: + * orbsvcs/ImplRepo_Service/Iterator.h: + * orbsvcs/ImplRepo_Service/Iterator.cpp: + * orbsvcs/ImplRepo_Service/LiveCheck.h: + * orbsvcs/ImplRepo_Service/LiveCheck.cpp: + + * orbsvcs/tests/Bug_3673_Regression: + + * orbsvcs/tests/Bug_3673_Regression/Bug_3673_Regression.mpc: + * orbsvcs/tests/Bug_3673_Regression/Hello.h: + * orbsvcs/tests/Bug_3673_Regression/Hello.cpp: + * orbsvcs/tests/Bug_3673_Regression/NamingTask.h: + * orbsvcs/tests/Bug_3673_Regression/NamingTask.cpp: + * orbsvcs/tests/Bug_3673_Regression/NsShutdown.h: + * orbsvcs/tests/Bug_3673_Regression/NsShutdown.cpp: + * orbsvcs/tests/Bug_3673_Regression/Test.idl: + * orbsvcs/tests/Bug_3673_Regression/client.cpp: + * orbsvcs/tests/Bug_3673_Regression/nsmain.cpp: + * orbsvcs/tests/Bug_3673_Regression/run_test.pl: + * orbsvcs/tests/Bug_3673_Regression/server.cpp: + + * orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl: + + * orbsvcs/tests/ImplRepo/servers_list/Test.idl: + * orbsvcs/tests/ImplRepo/servers_list/run_test.pl: + + * orbsvcs/tests/Notify/Bug_3646a_Regression: + + * orbsvcs/tests/Notify/Bug_3646a_Regression/Bug_3646a_Regression.mpc: + * orbsvcs/tests/Notify/Bug_3646a_Regression/Consumer.cpp: + * orbsvcs/tests/Notify/Bug_3646a_Regression/run_test.pl: + + * orbsvcs/tests/Notify/Bug_3646b_Regression: + + * orbsvcs/tests/Notify/Bug_3646b_Regression/Bug_3646b_Regression.mpc: + * orbsvcs/tests/Notify/Bug_3646b_Regression/DllORB.h: + * orbsvcs/tests/Notify/Bug_3646b_Regression/DllORB.cpp: + * orbsvcs/tests/Notify/Bug_3646b_Regression/bug3646b_export.h: + * orbsvcs/tests/Notify/Bug_3646b_Regression/run_test.pl: + * orbsvcs/tests/Notify/Bug_3646b_Regression/server.cpp: + + * orbsvcs/tests/Notify/Bug_3646c_Regression: + + * orbsvcs/tests/Notify/Bug_3646c_Regression/Bug_3646c_Regression.mpc: + * orbsvcs/tests/Notify/Bug_3646c_Regression/Consumer.cpp: + * orbsvcs/tests/Notify/Bug_3646c_Regression/DllORB.h: + * orbsvcs/tests/Notify/Bug_3646c_Regression/DllORB.cpp: + * orbsvcs/tests/Notify/Bug_3646c_Regression/bug3646c_export.h: + * orbsvcs/tests/Notify/Bug_3646c_Regression/run_test.pl: + * orbsvcs/tests/Notify/Bug_3646c_Regression/server.cpp: + + * orbsvcs/tests/Notify/Bug_3646d_Regression: + + * orbsvcs/tests/Notify/Bug_3646d_Regression/Bug_3646d_Regression.mpc: + * orbsvcs/tests/Notify/Bug_3646d_Regression/DllORB.h: + * orbsvcs/tests/Notify/Bug_3646d_Regression/DllORB.cpp: + * orbsvcs/tests/Notify/Bug_3646d_Regression/bug3646d_export.h: + * orbsvcs/tests/Notify/Bug_3646d_Regression/run_test.pl: + * orbsvcs/tests/Notify/Bug_3646d_Regression/server.cpp: + + * orbsvcs/tests/Notify/Bug_3663_Regression: + + * orbsvcs/tests/Notify/Bug_3663_Regression/Bug_3663_Regression.mpc: + * orbsvcs/tests/Notify/Bug_3663_Regression/DllORB.h: + * orbsvcs/tests/Notify/Bug_3663_Regression/DllORB.cpp: + * orbsvcs/tests/Notify/Bug_3663_Regression/bug3663_export.h: + * orbsvcs/tests/Notify/Bug_3663_Regression/run_test.pl: + * orbsvcs/tests/Notify/Bug_3663_Regression/server.cpp: + + * orbsvcs/tests/Notify/Bug_3688b_Regression: + + * orbsvcs/tests/Notify/Bug_3688b_Regression/Bug_3688b.mpc: + * orbsvcs/tests/Notify/Bug_3688b_Regression/DllORB.h: + * orbsvcs/tests/Notify/Bug_3688b_Regression/DllORB.cpp: + * orbsvcs/tests/Notify/Bug_3688b_Regression/TestBroadcaster.h: + * orbsvcs/tests/Notify/Bug_3688b_Regression/TestBroadcaster.cpp: + * orbsvcs/tests/Notify/Bug_3688b_Regression/TestListener.h: + * orbsvcs/tests/Notify/Bug_3688b_Regression/TestListener.cpp: + * orbsvcs/tests/Notify/Bug_3688b_Regression/bug3688_export.h: + * orbsvcs/tests/Notify/Bug_3688b_Regression/run_test.pl: + * orbsvcs/tests/Notify/Bug_3688b_Regression/server.cpp: + + * tao/Intrusive_Ref_Count_Handle_T.h: + * tao/Intrusive_Ref_Count_Handle_T.inl: + + * tests/Bug_3630_Regression: + + * tests/Bug_3630_Regression/Bug_3630_Regression.mpc: + * tests/Bug_3630_Regression/TAO Conf File.conf: + * tests/Bug_3630_Regression/TAO_Conf_File.conf: + * tests/Bug_3630_Regression/run_test.pl: + * tests/Bug_3630_Regression/server.cpp: + + * tests/Bug_3647_Regression/Backend_Impl.h: + * tests/Bug_3647_Regression/Middle_Impl.h: + + * tests/Bug_3672_Regression: + + * tests/Bug_3672_Regression/Bug_3672_Regression.mpc: + * tests/Bug_3672_Regression/ami_test.idl: + * tests/Bug_3672_Regression/ami_test_i.h: + * tests/Bug_3672_Regression/ami_test_i.cpp: + * tests/Bug_3672_Regression/client.cpp: + * tests/Bug_3672_Regression/run_test.pl: + * tests/Bug_3672_Regression/server.cpp: + + * tests/Bug_3683_Regression: + + * tests/Bug_3683_Regression/Bug_3683_Regression.mpc: + * tests/Bug_3683_Regression/Echo.idl: + * tests/Bug_3683_Regression/Echo_Client_i.h: + * tests/Bug_3683_Regression/Echo_Client_i.cpp: + * tests/Bug_3683_Regression/Echo_i.h: + * tests/Bug_3683_Regression/Echo_i.cpp: + * tests/Bug_3683_Regression/Simple_util.h: + * tests/Bug_3683_Regression/Simple_util.cpp: + * tests/Bug_3683_Regression/client.cpp: + * tests/Bug_3683_Regression/run_test.pl: + * tests/Bug_3683_Regression/server.cpp: + * tests/Bug_3683_Regression/svc.conf: + + * tests/Bug_3701_Regression: + + * tests/Bug_3701_Regression/Bug_3701_Regression.mpc: + * tests/Bug_3701_Regression/client.cpp: + * tests/Bug_3701_Regression/run_test.pl: + + * tests/RTCORBA/Bug_3643_Regression: + + * tests/RTCORBA/Bug_3643_Regression/Bug_3643_Regression.mpc: + * tests/RTCORBA/Bug_3643_Regression/client.cpp: + * tests/RTCORBA/Bug_3643_Regression/run_test.pl: + * tests/RTCORBA/Bug_3643_Regression/server.cpp: + * tests/RTCORBA/Bug_3643_Regression/svc.conf.dynamic: + * tests/RTCORBA/Bug_3643_Regression/test.idl: + * tests/RTCORBA/Bug_3643_Regression/test_i.h: + * tests/RTCORBA/Bug_3643_Regression/test_i.cpp: + Mon May 13 14:15:13 UTC 2013 Brian Johnson <johnsonb@ociweb.com> * orbsvcs/tests/LoadBalancing/GenericFactory/DeadMemberDetection_App_Ctrl/DMD_App_Ctrl.mpc: diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp index 4cfe53ee5e4..5ccef1c12d2 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.cpp @@ -76,8 +76,8 @@ AsyncAccessManager::add_interest (ImR_ResponseHandler *rh) { // This is not a leak. The listener registers with // the pinger and will delete itself when done. - AsyncLiveListener *l = 0; - ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(), + AccessLiveListener *l = 0; + ACE_NEW (l, AccessLiveListener (this->info_->name.c_str(), this, this->locator_.pinger())); LiveListener_ptr llp(l); @@ -199,17 +199,17 @@ AsyncAccessManager::server_is_running (const char *partial_ior, this->final_state (); } - AsyncLiveListener *l = 0; + AccessLiveListener *l = 0; if (this->info_->activation_mode == ImplementationRepository::PER_CLIENT) { - ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(), + ACE_NEW (l, AccessLiveListener (this->info_->name.c_str(), this, this->locator_.pinger(), this->info_->server.in())); } else { - ACE_NEW (l, AsyncLiveListener (this->info_->name.c_str(), + ACE_NEW (l, AccessLiveListener (this->info_->name.c_str(), this, this->locator_.pinger())); } @@ -308,7 +308,7 @@ AsyncAccessManager::send_start_request (void) } AsyncAccessManager * -AsyncAccessManager::add_ref (void) +AsyncAccessManager::_add_ref (void) { ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); ++this->refcount_; @@ -317,7 +317,7 @@ AsyncAccessManager::add_ref (void) } void -AsyncAccessManager::remove_ref (void) +AsyncAccessManager::_remove_ref (void) { int count = 0; { @@ -333,127 +333,9 @@ AsyncAccessManager::remove_ref (void) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -AsyncAccessManager_ptr::AsyncAccessManager_ptr (void) - : val_ (0) -{ -} - -AsyncAccessManager_ptr::AsyncAccessManager_ptr (AsyncAccessManager *aam) - :val_ (aam) -{ -} - -AsyncAccessManager_ptr::AsyncAccessManager_ptr (const AsyncAccessManager_ptr &aam_ptr) - :val_ (aam_ptr.clone()) -{ -} - -AsyncAccessManager_ptr::~AsyncAccessManager_ptr (void) -{ - if (val_ != 0) - { - val_->remove_ref(); - } -} - -AsyncAccessManager_ptr & -AsyncAccessManager_ptr::operator= (const AsyncAccessManager_ptr &aam_ptr) -{ - if (val_ != *aam_ptr) - { - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = aam_ptr.clone(); - } - return *this; -} - -AsyncAccessManager_ptr & -AsyncAccessManager_ptr::operator= (AsyncAccessManager *aam) -{ - if (val_ != aam) - { - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = aam; - } - return *this; -} - -const AsyncAccessManager * -AsyncAccessManager_ptr::operator-> () const -{ - return val_; -} - -const AsyncAccessManager * -AsyncAccessManager_ptr::operator* () const -{ - return val_; -} - -AsyncAccessManager * -AsyncAccessManager_ptr::operator-> () -{ - return val_; -} - -AsyncAccessManager * -AsyncAccessManager_ptr::operator* () -{ - return val_; -} - -bool -AsyncAccessManager_ptr::operator== (const AsyncAccessManager_ptr &aam_ptr) const -{ - return val_ == *aam_ptr; -} - -bool -AsyncAccessManager_ptr::operator== (const AsyncAccessManager *aam) const -{ - return val_ == aam; -} - -AsyncAccessManager * -AsyncAccessManager_ptr::clone (void) const -{ - if (val_ != 0) - { - val_->add_ref(); - } - return val_; -} - -AsyncAccessManager * -AsyncAccessManager_ptr::_retn (void) -{ - AsyncAccessManager * aam = val_; - val_ = 0; - return aam; -} - -void -AsyncAccessManager_ptr::assign (AsyncAccessManager *aam) -{ - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = aam; -} - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - ActivatorReceiver::ActivatorReceiver (AsyncAccessManager *aam, PortableServer::POA_ptr poa) - :aam_ (aam->add_ref ()), + :aam_ (aam->_add_ref ()), poa_ (PortableServer::POA::_duplicate (poa)) { } @@ -495,11 +377,11 @@ ActivatorReceiver::shutdown_excep (Messaging::ExceptionHolder * ) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -AsyncLiveListener::AsyncLiveListener (const char *server, +AccessLiveListener::AccessLiveListener (const char *server, AsyncAccessManager *aam, LiveCheck &pinger) :LiveListener (server), - aam_ (aam->add_ref ()), + aam_ (aam->_add_ref ()), pinger_ (pinger), status_ (LS_UNKNOWN), per_client_ (false), @@ -507,12 +389,12 @@ AsyncLiveListener::AsyncLiveListener (const char *server, { } -AsyncLiveListener::AsyncLiveListener (const char *server, +AccessLiveListener::AccessLiveListener (const char *server, AsyncAccessManager *aam, LiveCheck &pinger, ImplementationRepository::ServerObject_ptr ref) :LiveListener (server), - aam_ (aam->add_ref ()), + aam_ (aam->_add_ref ()), pinger_ (pinger), status_ (LS_UNKNOWN), per_client_ (true), @@ -520,12 +402,12 @@ AsyncLiveListener::AsyncLiveListener (const char *server, { } -AsyncLiveListener::~AsyncLiveListener (void) +AccessLiveListener::~AccessLiveListener (void) { } bool -AsyncLiveListener::start (void) +AccessLiveListener::start (void) { bool rtn = this->per_client_ ? this->pinger_.add_per_client_listener (this, srv_ref_.in()) : @@ -534,7 +416,7 @@ AsyncLiveListener::start (void) } bool -AsyncLiveListener::status_changed (LiveStatus status) +AccessLiveListener::status_changed (LiveStatus status) { this->status_ = status; if (status == LS_TRANSIENT) diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h index 1cfc0ea33d8..a071f88fa3a 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h @@ -22,10 +22,10 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/Intrusive_Ref_Count_Handle_T.h" #include "LiveCheck.h" class ImR_Locator_i; -class ImR_ReplyHandler; struct Server_Info; @@ -87,8 +87,8 @@ class AsyncAccessManager void notify_child_death (void); void ping_replied (LiveStatus server); - AsyncAccessManager *add_ref (void); - void remove_ref (void); + AsyncAccessManager *_add_ref (void); + void _remove_ref (void); private: void final_state (void); @@ -107,31 +107,7 @@ class AsyncAccessManager TAO_SYNCH_MUTEX lock_; }; -class AsyncAccessManager_ptr -{ -public: - AsyncAccessManager_ptr (void); - AsyncAccessManager_ptr (AsyncAccessManager *aam); - AsyncAccessManager_ptr (const AsyncAccessManager_ptr &aam_ptr); - ~AsyncAccessManager_ptr (void); - - AsyncAccessManager_ptr &operator = (const AsyncAccessManager_ptr &aam_ptr); - AsyncAccessManager_ptr &operator = (AsyncAccessManager *aam); - const AsyncAccessManager * operator-> () const; - const AsyncAccessManager * operator* () const; - AsyncAccessManager * operator-> (); - AsyncAccessManager * operator* (); - bool operator== (const AsyncAccessManager_ptr &aam_ptr) const; - bool operator== (const AsyncAccessManager *aam) const; - - AsyncAccessManager * clone (void) const; - AsyncAccessManager * _retn (void); - - void assign (AsyncAccessManager *aam); - -private: - AsyncAccessManager * val_; -}; +typedef TAO_Intrusive_Ref_Count_Handle<AsyncAccessManager> AsyncAccessManager_ptr; //---------------------------------------------------------------------------- /* @@ -165,19 +141,19 @@ private: /* */ -class AsyncLiveListener : public LiveListener +class AccessLiveListener : public LiveListener { public: - AsyncLiveListener (const char * server, + AccessLiveListener (const char * server, AsyncAccessManager *aam, LiveCheck &pinger, ImplementationRepository::ServerObject_ptr ref); - AsyncLiveListener (const char * server, + AccessLiveListener (const char * server, AsyncAccessManager *aam, LiveCheck &pinger); - virtual ~AsyncLiveListener (void); + virtual ~AccessLiveListener (void); bool start (void); bool status_changed (LiveStatus status); diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp new file mode 100644 index 00000000000..7a16a42750f --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp @@ -0,0 +1,278 @@ +// -*- C++ -*- +// $Id$ + +#include "AsyncListManager.h" +#include "Iterator.h" +#include "Locator_Repository.h" + +#include "orbsvcs/Log_Macros.h" + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- + +AsyncListManager::AsyncListManager (const Locator_Repository *repo, + PortableServer::POA_ptr poa, + LiveCheck *pinger) + :repo_ (repo), + poa_ (PortableServer::POA::_duplicate (poa)), + primary_ (ImplementationRepository::AMH_AdministrationResponseHandler::_nil ()), + secondary_ (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler::_nil ()), + pinger_ (pinger), + server_list_ (0), + first_ (0), + waiters_ (0), + refcount_ (1), + lock_ () +{ +} + +AsyncListManager::~AsyncListManager (void) +{ +} + +PortableServer::POA_ptr +AsyncListManager::poa (void) +{ + return PortableServer::POA::_duplicate (this->poa_.in()); +} + +void +AsyncListManager::final_state (void) +{ + if (this->pinger_ != 0 && this->waiters_ > 0) + { + return; + } + + bool excepted = false; + CORBA::ULong len = this->server_list_.length (); + + if (!CORBA::is_nil (this->primary_.in())) + { + ImplementationRepository::ServerInformationIterator_var server_iterator; + if (len < this->repo_->servers ().current_size()) + { + try + { + ImR_AsyncIterator* imr_iter = 0; + ACE_NEW_THROW_EX (imr_iter, + ImR_AsyncIterator (len, this), + CORBA::NO_MEMORY ()); + + PortableServer::ServantBase_var tmp (imr_iter); + + PortableServer::ObjectId_var id = + this->poa_->activate_object (imr_iter); + CORBA::Object_var obj = this->poa_->id_to_reference (id.in ()); + server_iterator = ImplementationRepository:: + ServerInformationIterator::_unchecked_narrow (obj.in ()); + } + catch (CORBA::Exception& ex) + { + ImplementationRepository::AMH_AdministrationExceptionHolder h (ex._tao_duplicate()); + this->primary_->list_excep (&h); + excepted = true; + } + } + else + { + server_iterator = + ImplementationRepository::ServerInformationIterator::_nil (); + } + + if (!excepted) + { + try + { + this->primary_->list (this->server_list_, server_iterator.in ()); + } + catch (CORBA::Exception &ex) + { + ex._tao_print_exception ("ALM:final state sending list\n"); + ImplementationRepository::AMH_AdministrationExceptionHolder h (ex._tao_duplicate()); + this->primary_->list_excep (&h); + } + } + this->primary_ = + ImplementationRepository::AMH_AdministrationResponseHandler::_nil (); + } + else if (!CORBA::is_nil (this->secondary_.in())) + { + CORBA::Boolean done = this->first_ + this->server_list_.length () >= + this->repo_->servers ().current_size (); + this->secondary_->next_n (done, this->server_list_); + this->secondary_ = + ImplementationRepository::AMH_ServerInformationIteratorResponseHandler::_nil (); + + } +} + +CORBA::ULong +AsyncListManager::list +(ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh, + CORBA::ULong start, + CORBA::ULong count) +{ + this->secondary_ = + ImplementationRepository::AMH_ServerInformationIteratorResponseHandler::_duplicate (_tao_rh); + this->list_i (start, count); + return this->first_ + this->server_list_.length (); +} + +void +AsyncListManager::list +(ImplementationRepository::AMH_AdministrationResponseHandler_ptr _tao_rh, + CORBA::ULong count) +{ + this->primary_ = + ImplementationRepository::AMH_AdministrationResponseHandler::_duplicate (_tao_rh); + this->list_i (0, count); +} + +void +AsyncListManager::list_i (CORBA::ULong start, CORBA::ULong how_many) +{ + this->first_ = start; + CORBA::ULong len = this->repo_->servers ().current_size () - start; + if (how_many > 0 && len > how_many) + { + len = how_many; + } + Locator_Repository::SIMap::ENTRY* entry = 0; + Locator_Repository::SIMap::CONST_ITERATOR it (this->repo_->servers ()); + for (;start > 0; start--) + { + it.advance (); + } + this->server_list_.length (len); + for (CORBA::ULong i = 0; i < len; i++) + { + it.next (entry); + it.advance (); + + Server_Info_Ptr info = entry->int_id_; + + this->server_list_[i].server = info->name.c_str (); + this->server_list_[i].startup.command_line = info->cmdline.c_str (); + this->server_list_[i].startup.environment = info->env_vars; + this->server_list_[i].startup.working_directory = info->dir.c_str (); + this->server_list_[i].startup.activation = info->activation_mode; + this->server_list_[i].startup.activator = info->activator.c_str (); + this->server_list_[i].startup.start_limit = info->start_limit; + this->server_list_[i].partial_ior = info->partial_ior.c_str (); + this->server_list_[i].activeStatus = ImplementationRepository::ACTIVE_MAYBE; + if (this->pinger_ != 0) + { + ListLiveListener *l = 0; + ACE_NEW (l, ListLiveListener (info->name.c_str (), + i, + this, + *this->pinger_)); + + LiveListener_ptr llp(l); + if (!l->start()) + { + this->server_list_[i].activeStatus = + ImplementationRepository::ACTIVE_NO; + } + } + } + if (len == 0 || this->pinger_ == 0) + { + this->final_state (); + } + else + { + this->waiters_ = len; + } +} + + +void +AsyncListManager::ping_replied (CORBA::ULong index, LiveStatus status) +{ + switch (status) + { + case LS_ALIVE: + case LS_LAST_TRANSIENT: + this->server_list_[index].activeStatus = + ImplementationRepository::ACTIVE_YES; + break; + case LS_TIMEDOUT: + this->server_list_[index].activeStatus = + ImplementationRepository::ACTIVE_MAYBE; + break; + case LS_DEAD: + this->server_list_[index].activeStatus = + ImplementationRepository::ACTIVE_NO; + break; + default: + return; + } + this->waiters_--; + this->final_state(); +} + +AsyncListManager * +AsyncListManager::_add_ref (void) +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); + ++this->refcount_; + + return this; +} + +void +AsyncListManager::_remove_ref (void) +{ + int count = 0; + { + ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); + count = --this->refcount_; + } + if (count == 0) + { + delete this; + } +} + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- + +ListLiveListener::ListLiveListener (const char *server, + CORBA::ULong index, + AsyncListManager *owner, + LiveCheck &pinger) + :LiveListener (server), + owner_ (owner->_add_ref ()), + pinger_ (pinger), + status_ (LS_UNKNOWN), + index_ (index) +{ +} + +ListLiveListener::~ListLiveListener (void) +{ +} + +bool +ListLiveListener::start (void) +{ + bool rtn = this->pinger_.add_listener (this); + return rtn; +} + +bool +ListLiveListener::status_changed (LiveStatus status) +{ + this->status_ = status; + if (status == LS_TRANSIENT) + { + return false; + } + else + { + this->owner_->ping_replied (this->index_, status); + } + return true; +} diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h new file mode 100644 index 00000000000..9aa5799b86e --- /dev/null +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h @@ -0,0 +1,107 @@ +// -*- C++ -*- +/* + * @file AsyncListManager.h + * + * $Id$ + * + * @author Phil Mesnier <mesnier_p@ociweb.com> + */ + +#ifndef IMR_ASYNCLISTMANAGER_H_ +#define IMR_ASYNCLISTMANAGER_H_ + +#include "locator_export.h" + +#include "ImR_LocatorC.h" +#include "ace/Vector_T.h" +#include "ace/SString.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +#pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Intrusive_Ref_Count_Handle_T.h" +#include "LiveCheck.h" + +class Locator_Repository; + +//---------------------------------------------------------------------------- +/* + * @class AsyncListManager + * + * @brief manages active detection of multiple servers to satisfy "list -a" + * + * A client of the locator may issue a list command to be filtered to + * currently active servers only. To satisfy that request each server must + * be pinged to determine liveness. The AsyncListManager handles the + * callbacks for all of the ping requests as efficiently as possible. + */ + +class AsyncListManager +{ + public: + AsyncListManager (const Locator_Repository *repo, + PortableServer::POA_ptr poa, + LiveCheck *pinger); + + ~AsyncListManager (void); + + PortableServer::POA_ptr poa (void); + void list (ImplementationRepository::AMH_AdministrationResponseHandler_ptr _tao_rh, + CORBA::ULong count); + + CORBA::ULong list (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh, + CORBA::ULong start, CORBA::ULong count); + + void ping_replied (CORBA::ULong index, LiveStatus status); + + AsyncListManager *_add_ref (void); + void _remove_ref (void); + + private: + void list_i (CORBA::ULong start, CORBA::ULong count); + void final_state (void); + + const Locator_Repository *repo_; + PortableServer::POA_var poa_; + ImplementationRepository::AMH_AdministrationResponseHandler_var primary_; + ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_var secondary_; + LiveCheck *pinger_; + ImplementationRepository::ServerInformationList server_list_; + CORBA::ULong first_; + CORBA::ULong waiters_; + int refcount_; + TAO_SYNCH_MUTEX lock_; +}; + +typedef TAO_Intrusive_Ref_Count_Handle<AsyncListManager> AsyncListManager_ptr; + +//---------------------------------------------------------------------------- +/* + */ + +class ListLiveListener : public LiveListener +{ + public: + ListLiveListener (const char * server, + CORBA::ULong index, + AsyncListManager *owner, + LiveCheck &pinger); + + virtual ~ListLiveListener (void); + bool start (void); + + bool status_changed (LiveStatus status); + + private: + AsyncListManager_ptr owner_; + LiveCheck &pinger_; + LiveStatus status_; + CORBA::ULong index_; +}; + + + + + +#endif /* IMR_ASYNCACCESSMANGER_H_ */ diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp index cee8302f9af..bf24cc46296 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp @@ -175,15 +175,8 @@ ImR_Locator_i::init_with_orb (CORBA::ORB_ptr orb, Options& opts) Locator_Repository::SIMap::ENTRY* entry = 0; Locator_Repository::SIMap::ITERATOR it (this->repository_->servers ()); - // Number of servers that will go into the server_list. - CORBA::ULong n = this->repository_->servers ().current_size (); - - for (CORBA::ULong i = 0; i < n; i++) + for (;it.next (entry) != 0; it.advance ()) { - it.next (entry); - it.advance (); - ACE_ASSERT (entry != 0); - const Server_Info& info = *(entry->int_id_); // ImplementationRepository::ServerInformation_var imr_info = // info.createImRServerInfo (); @@ -437,7 +430,7 @@ ImR_Locator_i::notify_child_death } AsyncAccessManager_ptr aam(this->find_aam (name)); - if (*aam != 0) + if (!aam.is_nil()) { aam->notify_child_death (); } @@ -565,7 +558,7 @@ ImR_Locator_i::activate_server_i (UpdateableServerInfo& info, else { aam = this->find_aam (info->name.c_str()); - if (*aam == 0) + if (aam.is_nil()) { AsyncAccessManager *aam_raw; ACE_NEW (aam_raw, AsyncAccessManager (*info, manual_start, *this)); @@ -1011,7 +1004,7 @@ ImR_Locator_i::server_is_running } AsyncAccessManager_ptr aam(this->find_aam (name.c_str())); - if (*aam != 0) + if (!aam.is_nil()) aam->server_is_running (partial_ior, s.in()); else { @@ -1058,7 +1051,7 @@ ImR_Locator_i::server_is_shutting_down this->pinger_.remove_server (server); { AsyncAccessManager_ptr aam = this->find_aam (server); - if (*aam != 0) + if (!aam.is_nil()) { aam->server_is_shutting_down (); } @@ -1092,7 +1085,8 @@ ImR_Locator_i::find } else { - ACE_NEW_THROW_EX (imr_info, ImplementationRepository::ServerInformation, + ACE_NEW_THROW_EX (imr_info, + ImplementationRepository::ServerInformation, CORBA::NO_MEMORY ()); imr_info->startup.activation= ImplementationRepository::NORMAL; if (debug_ > 1) @@ -1114,110 +1108,26 @@ void ImR_Locator_i::list (ImplementationRepository::AMH_AdministrationResponseHandler_ptr _tao_rh, CORBA::ULong how_many, - CORBA::Boolean determine_active_status) + CORBA::Boolean active) { - ImplementationRepository::ServerInformationList_var server_list; - ImplementationRepository::ServerInformationIterator_var server_iterator; - - if (debug_ > 1) - ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("ImR: List servers.\n"))); - - // Initialize the out variables, so if we return early, they will - // not be dangling. - server_iterator = ImplementationRepository::ServerInformationIterator::_nil (); + AsyncListManager *l = 0; try { - ACE_NEW_THROW_EX (server_list, - ImplementationRepository::ServerInformationList (0), + ACE_NEW_THROW_EX (l, + AsyncListManager (this->repository_.get(), + this->imr_poa_.in(), + active ? &this->pinger_ : 0), CORBA::NO_MEMORY ()); + AsyncListManager_ptr lister (l); + l->list (_tao_rh, how_many); } - catch (CORBA::Exception& ex) + catch (CORBA::Exception &ex) { ImplementationRepository::AMH_AdministrationExceptionHolder h (ex._tao_duplicate()); - _tao_rh->list_excep (&h); + _tao_rh->find_excep (&h); return; } - - Locator_Repository::SIMap::ENTRY* entry = 0; - Locator_Repository::SIMap::ITERATOR it (this->repository_->servers ()); - - // Number of servers that will go into the server_list. - CORBA::ULong n = this->repository_->servers ().current_size (); - if (how_many > 0 && n > how_many) - { - n = how_many; - } - - server_list->length (n); - - if (debug_ > 1) - { - ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("ImR_Locator_i::list: Filling ServerList with %d servers\n"), - n)); - } - - for (CORBA::ULong i = 0; i < n; i++) - { - it.next (entry); - it.advance (); - ACE_ASSERT (entry != 0); - - const Server_Info& info = *(entry->int_id_); - - ImplementationRepository::ServerInformation_var imr_info = - info.createImRServerInfo (); - if (determine_active_status) - { - UpdateableServerInfo updatable_info (info); - if (this->is_alive (updatable_info)) - { - imr_info->activeStatus = ImplementationRepository::ACTIVE_YES; - } - else - { - imr_info->activeStatus = ImplementationRepository::ACTIVE_NO; - if (debug_ > 0) - { - ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("ImR: Server %s is not active\n"), - info.name.c_str ())); - } - } - } - server_list[i] = *imr_info; - } - - if (this->repository_->servers ().current_size () > n) - { - if (debug_ > 1) - ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("ImR_Locator_i::list: Creating ServerInformation ") - ACE_TEXT ("Iterator\n"))); - - try - { - ImR_Iterator* imr_iter = 0; - ACE_NEW_THROW_EX (imr_iter, - ImR_Iterator (n, *this->repository_, this->imr_poa_.in ()), - CORBA::NO_MEMORY ()); - - PortableServer::ServantBase_var tmp (imr_iter); - - PortableServer::ObjectId_var id = - this->imr_poa_->activate_object (imr_iter); - CORBA::Object_var obj = this->imr_poa_->id_to_reference (id.in ()); - server_iterator = ImplementationRepository:: - ServerInformationIterator::_unchecked_narrow (obj.in ()); - } - catch (CORBA::Exception& ex) - { - ImplementationRepository::AMH_AdministrationExceptionHolder h (ex._tao_duplicate()); - _tao_rh->list_excep (&h); - } - } - _tao_rh->list (server_list.in(), server_iterator.in()); } Activator_Info_Ptr @@ -1434,7 +1344,7 @@ ImR_Locator_i::find_aam (const char *name) { if ((*i)->has_server (name)) { - return (*i)->add_ref(); + return (*i)->_add_ref(); } } return 0; diff --git a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc index cbb585df5b2..508eafcf728 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc +++ b/TAO/orbsvcs/ImplRepo_Service/ImplRepo_Service.mpc @@ -110,6 +110,7 @@ project(ImR_Locator) : orbsvcslib, orbsvcs_output, conv_lib, avoids_minimum_corb Activator_Info.cpp Adapter_Activator.cpp AsyncAccessManager.cpp + AsyncListManager.cpp Forwarder.cpp ImR_Locator_i.cpp ImR_ResponseHandler.cpp diff --git a/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp b/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp index 7e4182e08dc..abe512064a6 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/Iterator.cpp @@ -12,7 +12,36 @@ #include "Iterator.h" -ImR_Iterator::ImR_Iterator (CORBA::ULong n, Locator_Repository& repo, PortableServer::POA_ptr poa) + +ImR_AsyncIterator::ImR_AsyncIterator (CORBA::ULong start, + AsyncListManager *lister) + :count_ (start), + lister_ (lister->_add_ref ()) +{ +} + +void +ImR_AsyncIterator::next_n + (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh, + CORBA::ULong how_many) +{ + this->count_ = this->lister_->list (_tao_rh, this->count_, how_many); +} + +void +ImR_AsyncIterator::destroy + (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh) +{ + PortableServer::POA_var poa = this->lister_->poa (); + PortableServer::ObjectId_var oid = poa->servant_to_id (this); + poa->deactivate_object (oid.in()); + _tao_rh->destroy (); +} + +//---------------------------------------------------------------------------- +ImR_Iterator::ImR_Iterator (CORBA::ULong n, + Locator_Repository& repo, + PortableServer::POA_ptr poa) : repo_(repo) , count_(n) , poa_(poa) diff --git a/TAO/orbsvcs/ImplRepo_Service/Iterator.h b/TAO/orbsvcs/ImplRepo_Service/Iterator.h index db02e5f33b9..ff74eaee1ad 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Iterator.h +++ b/TAO/orbsvcs/ImplRepo_Service/Iterator.h @@ -15,6 +15,7 @@ #define IMR_ITERATOR_H #include "Locator_Repository.h" +#include "AsyncListManager.h" #include "tao/PortableServer/PortableServer.h" #include "ImplRepoS.h" @@ -22,6 +23,27 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ + + +class ImR_AsyncIterator + : public POA_ImplementationRepository::AMH_ServerInformationIterator +{ +public: + ImR_AsyncIterator (CORBA::ULong start, + AsyncListManager *lister); + + virtual void next_n + (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh, + CORBA::ULong how_many); + + virtual void destroy + (ImplementationRepository::AMH_ServerInformationIteratorResponseHandler_ptr _tao_rh); + +private: + CORBA::ULong count_; + AsyncListManager_ptr lister_; +}; + /** * @class ImR_Iterator * @@ -32,7 +54,9 @@ class ImR_Iterator : public POA_ImplementationRepository::ServerInformationIterator { public: - ImR_Iterator (CORBA::ULong n, Locator_Repository& repo, PortableServer::POA_ptr poa); + ImR_Iterator (CORBA::ULong start, + Locator_Repository& repo, + PortableServer::POA_ptr poa); /// Returns the next list of up to <how_many> servers. If empty, will return /// false. diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp index 76ef51a3ebc..58bd7c99ae3 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp @@ -28,7 +28,7 @@ LiveListener::server (void) const } LiveListener * -LiveListener::add_ref (void) +LiveListener::_add_ref (void) { ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); ++this->refcount_; @@ -36,7 +36,7 @@ LiveListener::add_ref (void) } void -LiveListener::remove_ref (void) +LiveListener::_remove_ref (void) { int count = 0; { @@ -52,124 +52,6 @@ LiveListener::remove_ref (void) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- -LiveListener_ptr::LiveListener_ptr (void) - : val_ (0) -{ -} - -LiveListener_ptr::LiveListener_ptr (LiveListener *ll) - :val_ (ll) -{ -} - -LiveListener_ptr::LiveListener_ptr (const LiveListener_ptr &ll_ptr) - :val_ (ll_ptr.clone()) -{ -} - -LiveListener_ptr::~LiveListener_ptr (void) -{ - if (val_ != 0) - { - val_->remove_ref(); - } -} - -LiveListener_ptr & -LiveListener_ptr::operator= (const LiveListener_ptr &ll_ptr) -{ - if (val_ != *ll_ptr) - { - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = ll_ptr.clone(); - } - return *this; -} - -LiveListener_ptr & -LiveListener_ptr::operator= (LiveListener *ll) -{ - if (val_ != ll) - { - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = ll; - } - return *this; -} - -const LiveListener * -LiveListener_ptr::operator-> () const -{ - return val_; -} - -const LiveListener * -LiveListener_ptr::operator* () const -{ - return val_; -} - -LiveListener * -LiveListener_ptr::operator-> () -{ - return val_; -} - -LiveListener * -LiveListener_ptr::operator* () -{ - return val_; -} - -bool -LiveListener_ptr::operator== (const LiveListener_ptr &ll_ptr) const -{ - return val_ == *ll_ptr; -} - -bool -LiveListener_ptr::operator== (const LiveListener *ll) const -{ - return val_ == ll; -} - -LiveListener * -LiveListener_ptr::clone (void) const -{ - if (val_ != 0) - { - val_->add_ref(); - } - return val_; -} - -LiveListener * -LiveListener_ptr::_retn (void) -{ - LiveListener * ll = val_; - val_ = 0; - return ll; -} - -void -LiveListener_ptr::assign (LiveListener *ll) -{ - if (val_ != 0) - { - val_->remove_ref(); - } - val_ = ll; -} - -//--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - const int LiveEntry::reping_msec_[] = {10, 100, 500, 1000, 1000, 2000, 2000, 5000, 5000}; int LiveEntry::reping_limit_ = sizeof (LiveEntry::reping_msec_) / sizeof (int); @@ -230,7 +112,7 @@ void LiveEntry::add_listener (LiveListener *ll) { ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - LiveListener_ptr llp(ll->add_ref()); + LiveListener_ptr llp(ll->_add_ref()); this->listeners_.insert (llp); } diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h index cc8b060e52b..da5195b9e79 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h @@ -23,6 +23,8 @@ #pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/Intrusive_Ref_Count_Handle_T.h" + class LiveCheck; //--------------------------------------------------------------------------- @@ -76,8 +78,8 @@ class Locator_Export LiveListener /// accessor for the server name. Used by the LiveCheck to associate a listener const char *server (void) const; - LiveListener *add_ref (void); - void remove_ref (void); + LiveListener *_add_ref (void); + void _remove_ref (void); private: ACE_CString server_; @@ -86,32 +88,7 @@ class Locator_Export LiveListener TAO_SYNCH_MUTEX lock_; }; -class LiveListener_ptr -{ -public: - LiveListener_ptr (void); - LiveListener_ptr (LiveListener *aam); - LiveListener_ptr (const LiveListener_ptr &aam_ptr); - ~LiveListener_ptr (void); - - LiveListener_ptr &operator = (const LiveListener_ptr &aam_ptr); - LiveListener_ptr &operator = (LiveListener *aam); - const LiveListener * operator-> () const; - const LiveListener * operator* () const; - LiveListener * operator-> (); - LiveListener * operator* (); - bool operator== (const LiveListener_ptr &aam_ptr) const; - bool operator== (const LiveListener *aam) const; - - LiveListener * clone (void) const; - LiveListener * _retn (void); - - void assign (LiveListener *aam); - -private: - LiveListener * val_; -}; - +typedef TAO_Intrusive_Ref_Count_Handle<LiveListener> LiveListener_ptr; //--------------------------------------------------------------------------- /* @@ -153,7 +130,6 @@ class Locator_Export LiveEntry ImplementationRepository::ServerObject_var ref_; LiveStatus liveliness_; ACE_Time_Value next_check_; - short retry_count_; int repings_; int max_retry_; bool may_ping_; diff --git a/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl index dd3a3855163..20b6c6a5dec 100755 --- a/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/ReconnectServer/run_test.pl @@ -33,7 +33,7 @@ my $ping_ext = ''; foreach my $i (@ARGV) { if ($i eq '-debug') { $debug_level = '10'; - $imr_debug_level = '1'; + $imr_debug_level = '3'; } if ($i eq '-forwardalways') { $delay = '5'; diff --git a/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl b/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl index 6624e95ac91..294bfad5aa7 100644 --- a/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl +++ b/TAO/orbsvcs/tests/ImplRepo/servers_list/Test.idl @@ -8,7 +8,7 @@ interface Test // After replying, abort process // delay_secs seconds. - void abort ( in short delay_secs ); + oneway void abort ( in short delay_secs ); }; diff --git a/TAO/orbsvcs/tests/ImplRepo/servers_list/run_test.pl b/TAO/orbsvcs/tests/ImplRepo/servers_list/run_test.pl index 1cc0254a984..f1df8de931c 100755 --- a/TAO/orbsvcs/tests/ImplRepo/servers_list/run_test.pl +++ b/TAO/orbsvcs/tests/ImplRepo/servers_list/run_test.pl @@ -91,6 +91,7 @@ my $imr_persistdat = $imr->LocalFile ($persistdat); $IMR = $imr->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_locator"); $ACT = $act->CreateProcess ("$ENV{TAO_ROOT}/orbsvcs/ImplRepo_Service/tao_imr_activator"); $TI = $ti->CreateProcess ("$ENV{ACE_ROOT}/bin/tao_imr"); + $CLI = $cli->CreateProcess ("client"); @SRV; my @srv_server_cmd; @@ -305,7 +306,7 @@ sub servers_list_test my $result = 0; my $start_time = time(); - $IMR->Arguments ("-d $debug_level -v 1000 -o $imr_imriorfile -orbendpoint iiop://:$port"); + $IMR->Arguments ("-d $debug_level -ORBDebugLevel $debug_level -v 1000 -o $imr_imriorfile -orbendpoint iiop://:$port"); ##### Start ImplRepo ##### $IMR_status = $IMR->Spawn (); @@ -357,7 +358,7 @@ sub servers_list_test if ($CLI_status != 0) { print STDERR "ERROR: client returned $CLI_status\n"; $status = 1; - return 1; +# return 1; } $SRV[$i]->Kill (); } diff --git a/TAO/tao/Intrusive_Ref_Count_Handle_T.h b/TAO/tao/Intrusive_Ref_Count_Handle_T.h index c936b9e039d..1a6561385fa 100644 --- a/TAO/tao/Intrusive_Ref_Count_Handle_T.h +++ b/TAO/tao/Intrusive_Ref_Count_Handle_T.h @@ -117,6 +117,10 @@ public: /// Always leaves the smart pointer in the "nil" state upon return. T* _retn (void); + /// Equality operator allows the refcounted object to be used generically + /// as a contained object + bool operator== (const TAO_Intrusive_Ref_Count_Handle& h) const; + private: /// Claim a "copy" of the reference-counted object by adding diff --git a/TAO/tao/Intrusive_Ref_Count_Handle_T.inl b/TAO/tao/Intrusive_Ref_Count_Handle_T.inl index a1ff0e5c12c..4286a4b5e26 100644 --- a/TAO/tao/Intrusive_Ref_Count_Handle_T.inl +++ b/TAO/tao/Intrusive_Ref_Count_Handle_T.inl @@ -132,6 +132,15 @@ TAO_Intrusive_Ref_Count_Handle<T>::_retn() template <typename T> ACE_INLINE +bool +TAO_Intrusive_Ref_Count_Handle<T>::operator== (const TAO_Intrusive_Ref_Count_Handle& h) const +{ + return this->ptr_ == h.in(); +} + + +template <typename T> +ACE_INLINE void TAO_Intrusive_Ref_Count_Handle<T>::claim() { |