summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-16 16:54:24 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-16 16:54:24 +0000
commit28c40fd85078d32da4fd3972ca0e7cfa6a19fa20 (patch)
treeeeefc27bd10ca3c95c9e6b5040dc4672dcca93cb
parent7b2c4fb80be914573b2756fad32ea21eb6a1e118 (diff)
downloadATCD-28c40fd85078d32da4fd3972ca0e7cfa6a19fa20.tar.gz
adding DS library support
-rw-r--r--TAO/tao/ORB_Core.cpp44
-rw-r--r--TAO/tao/ORB_Core.h18
-rw-r--r--TAO/tao/ORB_Core.inl6
3 files changed, 68 insertions, 0 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 85411bc3791..bd244a1a38b 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/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
@@ -1327,6 +1333,28 @@ 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)
+ throw ::CORBA::INITIALIZE (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_ORB_CORE_INIT_LOCATION_CODE,
+ 0),
+ CORBA::COMPLETED_NO);
+
+ // 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 ();
@@ -1708,6 +1736,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
@@ -1760,6 +1798,12 @@ TAO_ORB_Core::service_context_list (
{
// @NOTE: Can use Interceptors instead..
this->protocols_hooks_->rt_service_context (stub, service_context, restart);
+
+ // call the network priority protocols hooks that has been
+ // registered.
+ this->network_priority_protocols_hooks_->np_service_context (stub,
+ service_context,
+ restart);
}
TAO_Client_Strategy_Factory *
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index e423137e0e8..3b42fc720dd 100644
--- a/TAO/tao/ORB_Core.h
+++ b/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;
@@ -322,6 +323,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);
@@ -337,6 +342,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);
@@ -553,6 +562,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);
@@ -1272,6 +1284,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/TAO/tao/ORB_Core.inl b/TAO/tao/ORB_Core.inl
index 07ccb547c7c..825d94fe73c 100644
--- a/TAO/tao/ORB_Core.inl
+++ b/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)