diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-06-15 11:56:51 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-06-15 11:56:51 +0000 |
commit | c45fc78c0a9805810e0d395db1c083d20d213a8e (patch) | |
tree | 6d891754dcabe0c451129c79ffc7620cc6958a77 /TAO/tao | |
parent | 763d8d4ed4960e68745dd0379e340d466a0ded42 (diff) | |
download | ATCD-c45fc78c0a9805810e0d395db1c083d20d213a8e.tar.gz |
ChangeLogTag: Wed Jun 15 11:50:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Messaging/Messaging.cpp | 47 | ||||
-rw-r--r-- | TAO/tao/Messaging/Messaging_Loader.cpp | 82 | ||||
-rw-r--r-- | TAO/tao/Messaging/Messaging_Loader.h | 47 | ||||
-rw-r--r-- | TAO/tao/Messaging/Messaging_ORBInitializer.h | 4 | ||||
-rw-r--r-- | TAO/tao/PI/ORBInitializer_Registry_Impl.h | 9 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_ORBInitializer.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/RTScheduling/RTScheduler_Loader.h | 7 | ||||
-rw-r--r-- | TAO/tao/TAO_Internal.cpp | 8 |
8 files changed, 142 insertions, 64 deletions
diff --git a/TAO/tao/Messaging/Messaging.cpp b/TAO/tao/Messaging/Messaging.cpp index d01dee14bf9..6fa1ce3aaef 100644 --- a/TAO/tao/Messaging/Messaging.cpp +++ b/TAO/tao/Messaging/Messaging.cpp @@ -2,12 +2,11 @@ // $Id$ #include "Messaging.h" -#include "Messaging_ORBInitializer.h" +#include "Messaging_Loader.h" #include "tao/Exception_Data.h" #include "tao/debug.h" #include "tao/ORB_Constants.h" -#include "tao/ORBInitializer_Registry.h" #include "tao/CDR.h" #include "ace/Auto_Ptr.h" @@ -21,53 +20,11 @@ ACE_RCSID (Messaging, int TAO_Messaging_Initializer::init (void) { - - static int called_once = 0; - - if (called_once != 0) - return 0; - called_once = 1; - - PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = - PortableInterceptor::ORBInitializer::_nil (); - PortableInterceptor::ORBInitializer_var orb_initializer; - - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY - { - /// Register the Messaging ORBInitializer. - - ACE_NEW_THROW_EX (temp_orb_initializer, - TAO_Messaging_ORBInitializer, - CORBA::NO_MEMORY ( - CORBA::SystemException::_tao_minor_code ( - TAO::VMCID, - ENOMEM), - CORBA::COMPLETED_NO)); - ACE_TRY_CHECK; - - orb_initializer = temp_orb_initializer; - - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - if (TAO_debug_level > 0) - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "(%P | %t) Caught exception:"); - } - return -1; - } - ACE_ENDTRY; - + ACE_Service_Config::process_directive (ace_svc_desc_TAO_Messaging_Loader); return 0; } - void TAO_Messaging_Helper:: exception_holder_raise (TAO::Exception_Data *exception_data, CORBA::ULong exception_count, diff --git a/TAO/tao/Messaging/Messaging_Loader.cpp b/TAO/tao/Messaging/Messaging_Loader.cpp new file mode 100644 index 00000000000..08e0914d7ef --- /dev/null +++ b/TAO/tao/Messaging/Messaging_Loader.cpp @@ -0,0 +1,82 @@ + +// $Id$ + +#include "Messaging_Loader.h" +#include "Messaging_ORBInitializer.h" + +#include "tao/debug.h" +#include "tao/ORB_Core.h" +#include "tao/ORBInitializer_Registry.h" + +ACE_RCSID (TAO, Messaging_Loader, "$Id$") + + +TAO_Messaging_Loader::TAO_Messaging_Loader (void) +{ +} + +TAO_Messaging_Loader::~TAO_Messaging_Loader (void) +{ + +} + +int +TAO_Messaging_Loader::init (int, + ACE_TCHAR* []) +{ + ACE_TRACE ("TAO_Messaging_Loader::init"); + + static int called_once = 0; + + if (called_once != 0) + return 0; + called_once = 1; + + PortableInterceptor::ORBInitializer_ptr temp_orb_initializer = + PortableInterceptor::ORBInitializer::_nil (); + PortableInterceptor::ORBInitializer_var orb_initializer; + + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY + { + /// Register the Messaging ORBInitializer. + + ACE_NEW_THROW_EX (temp_orb_initializer, + TAO_Messaging_ORBInitializer, + CORBA::NO_MEMORY ( + CORBA::SystemException::_tao_minor_code ( + TAO::VMCID, + ENOMEM), + CORBA::COMPLETED_NO)); + ACE_TRY_CHECK; + + orb_initializer = temp_orb_initializer; + + PortableInterceptor::register_orb_initializer (orb_initializer.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + if (TAO_debug_level > 0) + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "(%P | %t) Caught exception:"); + } + return -1; + } + ACE_ENDTRY; + + return 0; +} + +///////////////////////////////////////////////////////////////////// + +ACE_FACTORY_DEFINE (TAO_Messaging, TAO_Messaging_Loader) +ACE_STATIC_SVC_DEFINE (TAO_Messaging_Loader, + ACE_TEXT ("Messaging_Loader"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_Messaging_Loader), + ACE_Service_Type::DELETE_THIS + | ACE_Service_Type::DELETE_OBJ, + 0) diff --git a/TAO/tao/Messaging/Messaging_Loader.h b/TAO/tao/Messaging/Messaging_Loader.h new file mode 100644 index 00000000000..08a4a7fd154 --- /dev/null +++ b/TAO/tao/Messaging/Messaging_Loader.h @@ -0,0 +1,47 @@ +/* -*- C++ -*- */ + +//============================================================================= +/** + * @file Messaging_Loader.h + * + * $Id$ + * + * Header file for Loading RTScheduler. + * + * + * @author Yamuna Krishnamurthy <yamuna@oomworks.com> + */ +//============================================================================= + +#ifndef TAO_RTSCHEDULER_LOADER_H +#define TAO_RTSCHEDULER_LOADER_H +#include /**/ "ace/pre.h" + +#include "messaging_export.h" + +#include "ace/Service_Object.h" +#include "ace/Service_Config.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_Messaging_Export TAO_Messaging_Loader : public ACE_Service_Object +{ +public: + /// Constructor. + TAO_Messaging_Loader (void); + + /// Destructor. + virtual ~TAO_Messaging_Loader (void); + + /// Initialize the Messaging loader hooks. + virtual int init (int argc, + ACE_TCHAR* []); +}; + +ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Messaging, TAO_Messaging_Loader) +ACE_FACTORY_DECLARE (TAO_Messaging, TAO_Messaging_Loader) + +#include /**/ "ace/post.h" +#endif /* TAO_RTSCHEDULER_LOADER_H */ diff --git a/TAO/tao/Messaging/Messaging_ORBInitializer.h b/TAO/tao/Messaging/Messaging_ORBInitializer.h index f16a1495ebe..4cd92a8d8e6 100644 --- a/TAO/tao/Messaging/Messaging_ORBInitializer.h +++ b/TAO/tao/Messaging/Messaging_ORBInitializer.h @@ -33,10 +33,6 @@ #endif /* _MSC_VER */ -/// Forward Declarations -class TAO_Messaging_PolicyFactory; - - /// Messaging ORB initializer. class TAO_Messaging_Export TAO_Messaging_ORBInitializer : public virtual PortableInterceptor::ORBInitializer, diff --git a/TAO/tao/PI/ORBInitializer_Registry_Impl.h b/TAO/tao/PI/ORBInitializer_Registry_Impl.h index c67065e8112..33cd3099e72 100644 --- a/TAO/tao/PI/ORBInitializer_Registry_Impl.h +++ b/TAO/tao/PI/ORBInitializer_Registry_Impl.h @@ -37,15 +37,6 @@ namespace TAO * * @brief Global list that contains all portable interceptor ORB * initializers. - * - * @note This class should be instantiated via its instance() - * method. Normally this would be enforced by making the - * constructor protected but that forces a friend declaration - * containing a template type (TAO_Singleton) with a static - * member to be introduced. In turn, this potentially - * introduces problems in MS Windows DLL environments due to - * the occurance of multiple singleton instances. There - * should only be one! */ class TAO_PI_Export ORBInitializer_Registry : public ORBInitializer_Registry_Adapter diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp index 285881291f5..75007008cfc 100644 --- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp +++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp @@ -122,7 +122,7 @@ TAO_RT_ORBInitializer::pre_init ( ACE_CHECK; // Create the initial priority mapping instance. - TAO_Network_Priority_Mapping *npm; + TAO_Network_Priority_Mapping *npm = 0; switch (this->network_priority_mapping_type_) { default: diff --git a/TAO/tao/RTScheduling/RTScheduler_Loader.h b/TAO/tao/RTScheduling/RTScheduler_Loader.h index 3f221ce27dd..2dc82785123 100644 --- a/TAO/tao/RTScheduling/RTScheduler_Loader.h +++ b/TAO/tao/RTScheduling/RTScheduler_Loader.h @@ -19,15 +19,12 @@ #include "rtscheduler_export.h" - -#include "ace/Service_Object.h" -#include "ace/Service_Config.h" - #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -class TAO_ORB_Core; +#include "ace/Service_Object.h" +#include "ace/Service_Config.h" class TAO_RTScheduler_Export TAO_RTScheduler_Loader : public ACE_Service_Object { diff --git a/TAO/tao/TAO_Internal.cpp b/TAO/tao/TAO_Internal.cpp index 6f8e213cc44..742d312a153 100644 --- a/TAO/tao/TAO_Internal.cpp +++ b/TAO/tao/TAO_Internal.cpp @@ -386,6 +386,14 @@ namespace rtscheduler_loader->init (0, 0); } + ACE_Service_Object * const messaging_loader = + ACE_Dynamic_Service<ACE_Service_Object>::instance ("Messaging_Loader"); + + if (messaging_loader != 0) + { + messaging_loader->init (0, 0); + } + // @@ What the heck do these things do and do we need to avoid // calling them if we're not invoking the svc.conf file? // @@ They are needed for platforms that have no file system, |