summaryrefslogtreecommitdiff
path: root/TAO/tao/CSD_Framework
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/CSD_Framework')
-rw-r--r--TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp35
-rw-r--r--TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp46
-rw-r--r--TAO/tao/CSD_Framework/CSD_ORBInitializer.h57
-rw-r--r--TAO/tao/CSD_Framework/CSD_Object_Adapter.h3
4 files changed, 135 insertions, 6 deletions
diff --git a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
index dcdcc711e48..44aa84728ff 100644
--- a/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
+++ b/TAO/tao/CSD_Framework/CSD_Framework_Loader.cpp
@@ -3,6 +3,8 @@
#include "tao/CSD_Framework/CSD_Framework_Loader.h"
#include "tao/CSD_Framework/CSD_Object_Adapter_Factory.h"
#include "tao/CSD_Framework/CSD_Strategy_Repository.h"
+#include "tao/CSD_Framework/CSD_ORBInitializer.h"
+#include "tao/ORBInitializer_Registry.h"
#include "ace/Dynamic_Service.h"
#include "ace/Service_Gestalt.h"
@@ -21,10 +23,35 @@ TAO_CSD_Framework_Loader::init (void)
(ace_svc_desc_TAO_CSD_Object_Adapter_Factory);
ACE_Service_Config::process_directive
- (ace_svc_desc_TAO_CSD_Strategy_Repository);
-
- TAO_ORB_Core::set_poa_factory ("TAO_CSD_Object_Adapter_Factory",
- "dynamic TAO_CSD_Object_Adapter_Factory Service_Object * TAO_CSD_Framework:_make_TAO_CSD_Object_Adapter_Factory()");
+ (ace_svc_desc_TAO_CSD_Strategy_Repository);
+
+ // Register the ORB initializer.
+ try
+ {
+ PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
+ PortableInterceptor::ORBInitializer::_nil ();
+
+ /// Register the RTCORBA ORBInitializer.
+ ACE_NEW_THROW_EX (temp_orb_initializer,
+ TAO_CSD_ORBInitializer,
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+
+ PortableInterceptor::ORBInitializer_var orb_initializer;
+ orb_initializer = temp_orb_initializer;
+
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+ }
+ catch (const ::CORBA::Exception& ex)
+ {
+ ex._tao_print_exception (
+ "Unexpected exception caught while "
+ "initializing the CSD Framework");
+ return 1;
+ }
return 0;
}
diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
new file mode 100644
index 00000000000..b3555b94a4c
--- /dev/null
+++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.cpp
@@ -0,0 +1,46 @@
+#include "tao/CSD_Framework/CSD_ORBInitializer.h"
+
+ACE_RCSID (CSD,
+ CSD_ORBInitializer,
+ "$Id$")
+
+
+#include "tao/Exception.h"
+#include "tao/ORB_Core.h"
+#include "tao/PI/ORBInitInfo.h"
+#include "tao/debug.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+void
+TAO_CSD_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr info)
+{
+ // Narrow to a TAO_ORBInitInfo object to get access to the
+ // orb_core() TAO extension.
+ TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info);
+
+ if (CORBA::is_nil (tao_info.in ()))
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ "(%P|%t) TAO_CSD_ORBInitializer::pre_init:\n"
+ "(%P|%t) Unable to narrow "
+ "\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
+ "(%P|%t) \"TAO_ORBInitInfo *.\"\n"));
+
+ throw ::CORBA::INTERNAL ();
+ }
+
+ // If the application resolves the root POA, make sure we load the CSD POA.
+ tao_info->orb_core ()->orb_params ()->poa_factory_name ("TAO_CSD_Object_Adapter_Factory");
+
+ tao_info->orb_core ()->orb_params ()->poa_factory_directive ("dynamic TAO_CSD_Object_Adapter_Factory Service_Object * TAO_CSD_Framework:_make_TAO_CSD_Object_Adapter_Factory()");
+}
+
+void
+TAO_CSD_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr)
+{
+}
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
diff --git a/TAO/tao/CSD_Framework/CSD_ORBInitializer.h b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h
new file mode 100644
index 00000000000..7b85d86fe57
--- /dev/null
+++ b/TAO/tao/CSD_Framework/CSD_ORBInitializer.h
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file CSD_ORBInitializer.h
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen <jwillemsen@remedy.nl>
+ */
+//=============================================================================
+
+
+#ifndef TAO_CSD_ORB_INITIALIZER_H
+#define TAO_CSD_ORB_INITIALIZER_H
+
+#include /**/ "ace/pre.h"
+
+#include "tao/orbconf.h"
+
+#include "tao/CSD_Framework/CSD_FW_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/PI/PI.h"
+#include "tao/LocalObject.h"
+
+// This is to remove "inherits via dominance" warnings from MSVC.
+// MSVC is being a little too paranoid.
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4250)
+#endif /* _MSC_VER */
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+class TAO_CSD_ORBInitializer
+ : public virtual PortableInterceptor::ORBInitializer
+ , public virtual TAO_Local_RefCounted_Object
+{
+public:
+ virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info);
+
+ virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info);
+};
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif /* _MSC_VER */
+
+#include /**/ "ace/post.h"
+
+#endif /* TAO_CSD_ORB_INITIALIZER_H */
diff --git a/TAO/tao/CSD_Framework/CSD_Object_Adapter.h b/TAO/tao/CSD_Framework/CSD_Object_Adapter.h
index 6a9346e75cc..f85ef6b26bc 100644
--- a/TAO/tao/CSD_Framework/CSD_Object_Adapter.h
+++ b/TAO/tao/CSD_Framework/CSD_Object_Adapter.h
@@ -47,8 +47,7 @@ public:
/// Hand the request to the Service_Dispatching_Strategy_Proxy for
/// dispatching.
virtual void do_dispatch (TAO_ServerRequest& req,
- TAO::Portable_Server::Servant_Upcall& upcall
- );
+ TAO::Portable_Server::Servant_Upcall& upcall);
};
TAO_END_VERSIONED_NAMESPACE_DECL