summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-30 19:22:05 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-30 19:22:05 +0000
commit34d3986e7fb8d366abbe324f5386b683a7c914c4 (patch)
treee8c444f99bc091f177451e5969a3908ed54cb8af
parentcf7741f58bd859c077313765fe766d3885a9b0a9 (diff)
downloadATCD-34d3986e7fb8d366abbe324f5386b683a7c914c4.tar.gz
added DS library
-rw-r--r--modules/TAO/tao/ORB_Core.cpp39
-rw-r--r--modules/TAO/tao/ORB_Core.h18
-rw-r--r--modules/TAO/tao/ORB_Core.inl6
3 files changed, 63 insertions, 0 deletions
diff --git a/modules/TAO/tao/ORB_Core.cpp b/modules/TAO/tao/ORB_Core.cpp
index 2b60f75309c..0df463c089e 100644
--- a/modules/TAO/tao/ORB_Core.cpp
+++ b/modules/TAO/tao/ORB_Core.cpp
@@ -23,6 +23,7 @@
#include "tao/Thread_Lane_Resources_Manager.h"
#include "tao/TSS_Resources.h"
#include "tao/Protocols_Hooks.h"
+#include "tao/Network_Priority_Protocols_Hooks.h"
#include "tao/IORInterceptor_Adapter.h"
#include "tao/IORInterceptor_Adapter_Factory.h"
#include "tao/debug.h"
@@ -148,6 +149,8 @@ TAO_ORB_Core_Static_Resources::instance (void)
TAO_ORB_Core_Static_Resources::TAO_ORB_Core_Static_Resources (void)
: sync_scope_hook_ (0),
protocols_hooks_name_ ("Protocols_Hooks"),
+ network_priority_protocols_hooks_name_ (
+ "Network_Priority_Protocols_Hooks"),
timeout_hook_ (0),
connection_timeout_hook_ (0),
endpoint_selector_factory_name_ ("Default_Endpoint_Selector_Factory"),
@@ -178,6 +181,8 @@ TAO_ORB_Core_Static_Resources::operator=(const TAO_ORB_Core_Static_Resources& ot
{
this->sync_scope_hook_ = other.sync_scope_hook_;
this->protocols_hooks_name_ = other.protocols_hooks_name_;
+ this->network_priority_protocols_hooks_name_ =
+ other.network_priority_protocols_hooks_name_;
this->timeout_hook_ = other.timeout_hook_;
this->connection_timeout_hook_ = other.connection_timeout_hook_;
this->endpoint_selector_factory_name_ =
@@ -204,6 +209,7 @@ TAO_ORB_Core_Static_Resources::operator=(const TAO_ORB_Core_Static_Resources& ot
TAO_ORB_Core::TAO_ORB_Core (const char *orbid)
: protocols_hooks_ (0),
+ network_priority_protocols_hooks_ (0),
#if TAO_USE_LOCAL_MEMORY_POOL == 1
use_local_memory_pool_ (true),
#else
@@ -1337,6 +1343,29 @@ TAO_ORB_Core::init (int &argc, char *argv[] )
// Initialize the protocols hooks instance.
this->protocols_hooks_->init_hooks (this);
+ // Look in the service repository for an instance of the
+ // Network Priority Protocol Hooks.
+ const ACE_CString &network_priority_protocols_hooks_name =
+ TAO_ORB_Core_Static_Resources::instance ()->
+ network_priority_protocols_hooks_name_;
+
+ this->network_priority_protocols_hooks_ =
+ ACE_Dynamic_Service<TAO_Network_Priority_Protocols_Hooks>::instance
+ (this->configuration (),
+ ACE_TEXT_CHAR_TO_TCHAR (network_priority_protocols_hooks_name.c_str()));
+
+ // Must have valid protocol hooks.
+ if (this->network_priority_protocols_hooks_ == 0)
+ ACE_THROW_RETURN (CORBA::INITIALIZE (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_ORB_CORE_INIT_LOCATION_CODE,
+ 0),
+ CORBA::COMPLETED_NO),
+ -1);
+
+ // Initialize the protocols hooks instance.
+ this->network_priority_protocols_hooks_->init_hooks (this);
+
// As a last step perform initializations of the service callbacks
this->services_callbacks_init ();
@@ -1718,6 +1747,16 @@ TAO_ORB_Core::set_protocols_hooks (const char *protocols_hooks_name)
}
void
+TAO_ORB_Core::set_network_priority_protocols_hooks (
+ const char *network_priority_protocols_hooks_name)
+{
+ // Is synchronization necessary?
+ TAO_ORB_Core_Static_Resources::instance ()->
+ network_priority_protocols_hooks_name_ =
+ network_priority_protocols_hooks_name;
+}
+
+void
TAO_ORB_Core::services_callbacks_init (void)
{
// We (should) know what are the services that would need
diff --git a/modules/TAO/tao/ORB_Core.h b/modules/TAO/tao/ORB_Core.h
index 71e5cac98db..f16759e92b5 100644
--- a/modules/TAO/tao/ORB_Core.h
+++ b/modules/TAO/tao/ORB_Core.h
@@ -80,6 +80,7 @@ class TAO_Profile;
class TAO_Endpoint_Selector_Factory;
class TAO_Message_State_Factory;
class TAO_Protocols_Hooks;
+class TAO_Network_Priority_Protocols_Hooks;
class TAO_BiDir_Adapter;
class TAO_Flushing_Strategy;
@@ -323,6 +324,10 @@ public:
/// Sets the value of TAO_ORB_Core::protocols_hooks_
static void set_protocols_hooks (const char *protocols_hooks_name);
+ /// Sets the value of TAO_ORB_Core::network_priority_protocols_hooks_
+ static void set_network_priority_protocols_hooks (
+ const char *network_priority_protocols_hooks_name);
+
/// Sets the value of TAO_ORB_Core::endpoint_selector_factory_
static void set_endpoint_selector_factory (
const char *endpoint_selector_factory_name);
@@ -338,6 +343,10 @@ public:
/// Gets the value of TAO_ORB_Core::protocols_hooks__
TAO_Protocols_Hooks * get_protocols_hooks (void);
+ /// Gets the value of TAO_ORB_Core::network_priority_protocols_hooks__
+ TAO_Network_Priority_Protocols_Hooks *
+ get_network_priority_protocols_hooks (void);
+
/// Sets the value of TAO_ORB_Core::dynamic_adapter_name_.
static void dynamic_adapter_name (const char *name);
@@ -554,6 +563,9 @@ public:
/// Handle to the factory for protocols_hooks_..
TAO_Protocols_Hooks *protocols_hooks_;
+ /// Handle to the factory for network_priority_protocols_hooks_..
+ TAO_Network_Priority_Protocols_Hooks *network_priority_protocols_hooks_;
+
/// Obtain the TSS resources of this orb.
TAO_ORB_Core_TSS_Resources* get_tss_resources (void);
@@ -1273,6 +1285,12 @@ public:
*/
ACE_CString protocols_hooks_name_;
+
+ /**
+ * Name of the network_priority_protocols_hooks that needs to be instantiated.
+ */
+ ACE_CString network_priority_protocols_hooks_name_;
+
/// The hook to be set for the RelativeRoundtripTimeoutPolicy.
TAO_ORB_Core::Timeout_Hook timeout_hook_;
diff --git a/modules/TAO/tao/ORB_Core.inl b/modules/TAO/tao/ORB_Core.inl
index 07ccb547c7c..825d94fe73c 100644
--- a/modules/TAO/tao/ORB_Core.inl
+++ b/modules/TAO/tao/ORB_Core.inl
@@ -75,6 +75,12 @@ TAO_ORB_Core::get_protocols_hooks (void)
return this->protocols_hooks_;
}
+ACE_INLINE TAO_Network_Priority_Protocols_Hooks *
+TAO_ORB_Core::get_network_priority_protocols_hooks (void)
+{
+ return this->network_priority_protocols_hooks_;
+}
+
ACE_INLINE CORBA::Boolean
TAO_ORB_Core::service_profile_selection (const TAO_MProfile &mprofile,
TAO_Profile *&profile)