diff options
author | Simon McQueen <simon.mcqueen@gmail.com> | 2005-07-29 17:07:14 +0000 |
---|---|---|
committer | Simon McQueen <simon.mcqueen@gmail.com> | 2005-07-29 17:07:14 +0000 |
commit | 7c7c80ed4768b3cfda0af056a621df0c767dd3f0 (patch) | |
tree | 79af2f1d57e2b19bbad55df419493d32349b038c | |
parent | de62ff2ac33ad52762b05893c0156c501d8d0bf1 (diff) | |
download | ATCD-7c7c80ed4768b3cfda0af056a621df0c767dd3f0.tar.gz |
ChangeLogTag: Fri Jul 29 17:55:23 2005 Simon McQueen <sm@prismtech.com>
-rw-r--r-- | TAO/ChangeLog | 18 | ||||
-rw-r--r-- | TAO/tao/ImR_Client/ImR_Client.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.h | 3 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.i | 6 | ||||
-rw-r--r-- | TAO/tao/PortableServer/LifespanStrategyPersistent.cpp | 73 | ||||
-rw-r--r-- | TAO/tao/PortableServer/LifespanStrategyPersistent.h | 2 |
6 files changed, 92 insertions, 29 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2eef8d3b895..1adcc6b34b1 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,21 @@ +Fri Jul 29 17:55:23 2005 Simon McQueen <sm@prismtech.com> + + * tao/ORB_Core.h: + * tao/ORB_Core.i: + + Add accessor for use_implrepo_ value. + + * tao/ImR_Client/ImR_Client.cpp: + + Make calling imr_notify_startup when the ImR ref cannot be + found or narrowed into an error condition. + + * tao/PortableServer/LifespanStrategyPersistent.h: + * tao/PortableServer/LifespanStrategyPersistent.cpp: + + Read the use_imr_ value from the ORB core. Only try and load + the ImR_Client and call imr_notify_startup if use_imr_ set. + Fri Jul 29 14:15:11 2005 Simon McQueen <sm@prismtech.com> * tests/Bug_1020_Basic_Regression/Server_Task.cpp: diff --git a/TAO/tao/ImR_Client/ImR_Client.cpp b/TAO/tao/ImR_Client/ImR_Client.cpp index 8a4654b610c..429f4f0f569 100644 --- a/TAO/tao/ImR_Client/ImR_Client.cpp +++ b/TAO/tao/ImR_Client/ImR_Client.cpp @@ -31,7 +31,14 @@ namespace TAO CORBA::Object_var imr = poa->orb_core ().implrepo_service (); if (CORBA::is_nil (imr.in ())) - return; + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) ERROR: No usable IMR initial reference ") + ACE_TEXT ("available but use IMR has been specified.\n"))); + ACE_THROW ((CORBA::TRANSIENT ( + CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), + CORBA::COMPLETED_NO)); + } if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Notifying ImR of startup\n")); @@ -49,7 +56,15 @@ namespace TAO } if (CORBA::is_nil(imr_locator.in ())) - return; + { + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) ERROR: Narrowed IMR initial reference ") + ACE_TEXT ("is nil but use IMR has been specified.\n"))); + + ACE_THROW ((CORBA::TRANSIENT ( + CORBA::SystemException::_tao_minor_code (TAO_IMPLREPO_MINOR_CODE, 0), + CORBA::COMPLETED_NO)); + } TAO_Root_POA *root_poa = poa->object_adapter ().root_poa (); ACE_NEW_THROW_EX (this->server_object_, diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 229b151f8e6..524d1811834 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -637,6 +637,9 @@ public: void implrepo_service (const CORBA::Object_ptr ir); //@} + /// Do we attempt to register with the Implementation Repository + CORBA::Boolean use_implrepo (void); + /// Do we put the ImR's endpoints into persistent object references we create CORBA::Boolean imr_endpoints_in_ior (void); diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 41b493ce99d..60b9a0db058 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -401,6 +401,12 @@ TAO_ORB_Core::implrepo_service (const CORBA::Object_ptr ir) } ACE_INLINE CORBA::Boolean +TAO_ORB_Core::use_implrepo (void) +{ + return use_implrepo_; +} + +ACE_INLINE CORBA::Boolean TAO_ORB_Core::imr_endpoints_in_ior (void) { return imr_endpoints_in_ior_; diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp index d850d2ce6ec..c8482751d98 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.cpp @@ -18,6 +18,15 @@ namespace TAO { namespace Portable_Server { + void + LifespanStrategyPersistent::strategy_init ( + TAO_Root_POA *poa + ACE_ENV_ARG_DECL) + { + LifespanStrategy::strategy_init (poa ACE_ENV_ARG_PARAMETER); + this->use_imr_ = this->poa_->orb_core ().use_implrepo (); + } + bool LifespanStrategyPersistent::validate ( CORBA::Boolean is_persistent, @@ -57,37 +66,47 @@ namespace TAO void LifespanStrategyPersistent::notify_startup (ACE_ENV_SINGLE_ARG_DECL) { - ImR_Client_Adapter *adapter = - ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( - TAO_Root_POA::imr_client_adapter_name () - ); - -#if !defined (TAO_AS_STATIC_LIBS) - // In case we build shared, try to load the ImR Client library, in a - // static build we just can't do this, so don't try it, lower layers - // output an error then. - if (adapter == 0) + if (this->use_imr_) { - ACE_Service_Config::process_directive ( - ACE_DYNAMIC_SERVICE_DIRECTIVE( - "ImR_Client_Adapter", "TAO_ImR_Client", - "_make_ImR_Client_Adapter_Impl", "")); - - adapter = + // The user specified that the ImR should be used. + ImR_Client_Adapter *adapter = ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( - TAO_Root_POA::imr_client_adapter_name ()); - } -#endif /* !TAO_AS_STATIC_LIBS */ + TAO_Root_POA::imr_client_adapter_name () + ); - if (adapter != 0) - { - bool old_use_imr = this->use_imr_; - this->use_imr_ = false; - - adapter->imr_notify_startup (this->poa_ ACE_ENV_ARG_PARAMETER); - ACE_CHECK; +#if !defined (TAO_AS_STATIC_LIBS) + // In case we build shared, try to load the ImR Client library, in a + // static build we just can't do this, so don't try it, lower layers + // output an error then. + if (adapter == 0) + { + ACE_Service_Config::process_directive ( + ACE_DYNAMIC_SERVICE_DIRECTIVE( + "ImR_Client_Adapter", "TAO_ImR_Client", + "_make_ImR_Client_Adapter_Impl", "")); + + adapter = + ACE_Dynamic_Service<ImR_Client_Adapter>::instance ( + TAO_Root_POA::imr_client_adapter_name ()); + } +#endif /* !TAO_AS_STATIC_LIBS */ - this->use_imr_ = old_use_imr; + if (adapter != 0) + { + adapter->imr_notify_startup (this->poa_ ACE_ENV_ARG_PARAMETER); + ACE_CHECK; + } + else + { + // When we don't have a ImR_Client adapter, but the user + // has specified that the ImR has to be used we have an + // error situation which has to be reported. + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("(%P|%t) ERROR: No ImR_Client library ") + ACE_TEXT ("available but use IMR has been specified.\n"))); + + ACE_THROW (CORBA::INTERNAL ()); + } } } diff --git a/TAO/tao/PortableServer/LifespanStrategyPersistent.h b/TAO/tao/PortableServer/LifespanStrategyPersistent.h index ac064a22463..00ea12a2e5c 100644 --- a/TAO/tao/PortableServer/LifespanStrategyPersistent.h +++ b/TAO/tao/PortableServer/LifespanStrategyPersistent.h @@ -34,6 +34,8 @@ namespace TAO public: LifespanStrategyPersistent (); + virtual void strategy_init(TAO_Root_POA *poa ACE_ENV_ARG_DECL); + virtual void notify_startup (ACE_ENV_SINGLE_ARG_DECL); virtual void notify_shutdown (ACE_ENV_SINGLE_ARG_DECL); |