diff options
author | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-20 14:33:20 +0000 |
---|---|---|
committer | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-20 14:33:20 +0000 |
commit | 30124d8d2aa5d8a3f54f53d9a0c56589089d184f (patch) | |
tree | d97d5947fff01c3053c287743fcbe786e96ccead | |
parent | c4e314de9d3855adf5385262a76ff1e7d3134a23 (diff) | |
download | ATCD-30124d8d2aa5d8a3f54f53d9a0c56589089d184f.tar.gz |
ChangeLogTag:Wed Jun 20 09:29:20 2001 Frank Hunleth <fhunleth@cs.wustl.edu>
-rw-r--r-- | TAO/ChangeLogs/ChangeLog-02a | 12 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_ORB_Loader.cpp | 36 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_ORB_Loader.h | 7 |
3 files changed, 42 insertions, 13 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index 2950c6a68ac..8a9f2ffd846 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,15 @@ +Wed Jun 20 09:29:20 2001 Frank Hunleth <fhunleth@cs.wustl.edu> + + * tao/RTCORBA/RT_ORB_Loader.h: + * tao/RTCORBA/RT_ORB_Loader.cpp: + + Added checks to make sure that all of the RTCORBA hooks have + been successfully registered before allowing an application + to resolve the RTORB and RTCurrent. This should make errors + when the RT CORBA service configurator option is missing + a little easier to diagnose. Thanks to Craig Rodrigues for + instigating this change with his questions. + Wed Jun 20 09:19:32 2001 Frank Hunleth <fhunleth@cs.wustl.edu> * tests/RTCORBA/MT_Client_Protocol_Priority/svc.conf: diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp index 754c7403026..82ec69e76e4 100644 --- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp +++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp @@ -19,13 +19,11 @@ TAO_RT_ORB_Loader::Initializer (void) ACE_Service_Config::static_svcs ()-> insert (&ace_svc_desc_TAO_RT_ORB_Loader); - ACE_Service_Config::static_svcs ()-> - insert (&ace_svc_desc_TAO_RT_Current_Loader); - return 0; } TAO_RT_ORB_Loader::TAO_RT_ORB_Loader (void) + : initialized_ (0) { } @@ -147,6 +145,13 @@ TAO_RT_ORB_Loader::init (int argc, } ACE_ENDTRY; + // Allow someone to retrieve RTORB. + this->initialized_ = 1; + + // Allow someone to retrieve RTCurrent now. + ACE_Service_Config::static_svcs ()-> + insert (&ace_svc_desc_TAO_RT_Current_Loader); + return 0; } @@ -157,17 +162,22 @@ TAO_RT_ORB_Loader::create_object (CORBA::ORB_ptr orb, CORBA::Environment &ACE_TRY_ENV) ACE_THROW_SPEC ((CORBA::SystemException)) { - /// Return RT_ORB - CORBA::Object_ptr rt_orb; + // Return RT_ORB + CORBA::Object_ptr rt_orb = CORBA::Object::_nil (); - ACE_NEW_THROW_EX (rt_orb, - TAO_RT_ORB (orb), - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_CHECK_RETURN (CORBA::Object::_nil ()); + // Check that all of the RTCORBA hooks have been initialized + // successfully. + if (this->initialized_) + { + ACE_NEW_THROW_EX (rt_orb, + TAO_RT_ORB (orb), + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_CHECK_RETURN (CORBA::Object::_nil ()); + } return rt_orb; } diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.h b/TAO/tao/RTCORBA/RT_ORB_Loader.h index 17147aa7607..118f1431da9 100644 --- a/TAO/tao/RTCORBA/RT_ORB_Loader.h +++ b/TAO/tao/RTCORBA/RT_ORB_Loader.h @@ -57,6 +57,13 @@ public: /// Used to force the initialization of the ORB code. static int Initializer (void); + +private: + + /// Flag to indicate whether the RT_ORB_Loader has been initialized. + /// If it hasn't, it should give back an RTORB since not all of the + /// RTCORBA hooks are in place. + int initialized_; }; ACE_STATIC_SVC_DECLARE_EXPORT (TAO_RTCORBA, TAO_RT_ORB_Loader) |