summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/tao/Messaging/Messaging.cpp47
-rw-r--r--TAO/tao/Messaging/Messaging_Loader.cpp82
-rw-r--r--TAO/tao/Messaging/Messaging_Loader.h47
-rw-r--r--TAO/tao/Messaging/Messaging_ORBInitializer.h4
-rw-r--r--TAO/tao/PI/ORBInitializer_Registry_Impl.h9
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.cpp2
-rw-r--r--TAO/tao/RTScheduling/RTScheduler_Loader.h7
-rw-r--r--TAO/tao/TAO_Internal.cpp8
-rw-r--r--TAO/tests/Param_Test/Param_Test.mpc6
9 files changed, 145 insertions, 67 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,
diff --git a/TAO/tests/Param_Test/Param_Test.mpc b/TAO/tests/Param_Test/Param_Test.mpc
index 0967155b0dc..41eaa3752a8 100644
--- a/TAO/tests/Param_Test/Param_Test.mpc
+++ b/TAO/tests/Param_Test/Param_Test.mpc
@@ -1,7 +1,7 @@
// -*- MPC -*-
// $Id$
-project(*Server): messaging, taoexe, portableserver, minimum_corba {
+project(*Server): taoserver, minimum_corba {
idlflags += -GA
Source_Files {
@@ -10,7 +10,7 @@ project(*Server): messaging, taoexe, portableserver, minimum_corba {
}
}
-project(*Client): messaging, taoexe, portableserver, minimum_corba, dynamicinterface {
+project(*Client): taoserver, minimum_corba, dynamicinterface {
exename = client
idlflags += -GA
@@ -60,7 +60,7 @@ project(*Client): messaging, taoexe, portableserver, minimum_corba, dynamicinter
}
}
-project(*Anyop): messaging, taoexe, portableserver, minimum_corba {
+project(*Anyop): taoserver, minimum_corba {
idlflags += -GA
Source_Files {