summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 17:37:46 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-29 17:37:46 +0000
commitf1cf69b18aa1daa7ab92692e42394ed2ceb84c86 (patch)
tree12ab44e19436429dacf922caff591b8e1e00cc63
parentb1d24894a3808c40bf1fa232596826000f189d56 (diff)
downloadATCD-f1cf69b18aa1daa7ab92692e42394ed2ceb84c86.tar.gz
changes for DS library
-rw-r--r--TAO/tao/ORB_Core.cpp158
-rw-r--r--TAO/tao/ORB_Core.h75
-rw-r--r--TAO/tao/ORB_Core.inl24
3 files changed, 256 insertions, 1 deletions
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index 0734d479dd1..a9e1028e32d 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -23,6 +23,10 @@
#include "tao/Thread_Lane_Resources_Manager.h"
#include "tao/TSS_Resources.h"
#include "tao/Protocols_Hooks.h"
+#include "tao/Policy_Protocols_Hooks.h"
+#include "tao/Protocols_Properties_Protocols_Hooks.h"
+#include "tao/Network_Priority_Protocols_Hooks.h"
+#include "tao/Thread_Priority_Protocols_Hooks.h"
#include "tao/IORInterceptor_Adapter.h"
#include "tao/IORInterceptor_Adapter_Factory.h"
#include "tao/debug.h"
@@ -148,6 +152,11 @@ 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"),
+ policy_protocols_hooks_name_ ("Policy_Protocols_Hooks"),
+ protocols_properties_protocols_hooks_name_
+ ("Protocols_Properties_Protocols_Hooks"),
+ network_priority_protocols_hooks_name_ ("Network_Priority_Protocols_Hooks"),
+ thread_priority_protocols_hooks_name_ ("Thread_Priority_Protocols_Hooks"),
timeout_hook_ (0),
connection_timeout_hook_ (0),
endpoint_selector_factory_name_ ("Default_Endpoint_Selector_Factory"),
@@ -178,6 +187,13 @@ 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->policy_protocols_hooks_name_ = other.policy_protocols_hooks_name_;
+ this->protocols_properties_protocols_hooks_name_ =
+ other.protocols_properties_protocols_hooks_name_;
+ this->network_priority_protocols_hooks_name_ =
+ other.network_priority_protocols_hooks_name_;
+ this->thread_priority_protocols_hooks_name_ =
+ other.thread_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 +220,10 @@ 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),
+ policy_protocols_hooks_ (0),
+ protocols_properties_policy_protocols_hooks_ (0),
+ network_priority_policy_protocols_hooks_ (0),
+ thread_priority_policy_protocols_hooks_ (0),
#if TAO_USE_LOCAL_MEMORY_POOL == 1
use_local_memory_pool_ (true),
#else
@@ -1334,6 +1354,105 @@ TAO_ORB_Core::init (int &argc, char *argv[] ACE_ENV_ARG_DECL)
ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (-1);
+ // Look in the service repository for an instance of
+ // the Policy Protocol Hooks.
+ const ACE_CString &policy_protocols_hooks_name =
+ TAO_ORB_Core_Static_Resources::instance ()->
+ policy_protocols_hooks_name_;
+
+ this->policy_protocols_hooks_ =
+ ACE_Dynamic_Service<TAO_Policy_Protocols_Hooks>::instance
+ (this->configuration (),
+ ACE_TEXT_CHAR_TO_TCHAR (policy_protocols_hooks_name.c_str()));
+
+ // Must have valid protocol hooks.
+ if (this->policy_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->policy_protocols_hooks_->init_hooks (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Look in the service repository for an instance
+ // of the Protocols Properties Protocol Hooks.
+ const ACE_CString &protocols_properties_protocols_hooks_name =
+ TAO_ORB_Core_Static_Resources::instance ()->
+ protocols_properties_protocols_hooks_name_;
+
+ this->protocols_properties_protocols_hooks_ =
+ ACE_Dynamic_Service<TAO_Protocols_Properties_Protocols_Hooks>::instance
+ (this->configuration (),
+ ACE_TEXT_CHAR_TO_TCHAR (
+ protocols_properties_protocols_hooks_name.c_str()));
+
+ // Must have valid protocol hooks.
+ if (this->protocols_properties_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->protocols_properties_protocols_hooks_->init_hooks (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Look in the service repository for an instance of the 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
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
+ // Look in the service repository for an instance of the Protocol Hooks.
+ const ACE_CString &thread_priority_protocols_hooks_name =
+ TAO_ORB_Core_Static_Resources::instance ()->
+ thread_priority_protocols_hooks_name_;
+
+ this->thread_priority_protocols_hooks_ =
+ ACE_Dynamic_Service<TAO_Thread_Priority_Protocols_Hooks>::instance
+ (this->configuration (),
+ ACE_TEXT_CHAR_TO_TCHAR (thread_priority_protocols_hooks_name.c_str()));
+
+ // Must have valid protocol hooks.
+ if (this->thread_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->thread_priority_protocols_hooks_->init_hooks (this
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK_RETURN (-1);
+
// As a last step perform initializations of the service callbacks
this->services_callbacks_init ();
@@ -1714,6 +1833,45 @@ TAO_ORB_Core::set_protocols_hooks (const char *protocols_hooks_name)
}
void
+TAO_ORB_Core::set_policy_protocols_hooks (
+ const char *policy_protocols_hooks_name)
+{
+ // Is synchronization necessary?
+ TAO_ORB_Core_Static_Resources::instance ()->policy_protocols_hooks_name_ =
+ policy_protocols_hooks_name;
+}
+
+void
+TAO_ORB_Core::set_protocols_properties_protocols_hooks (
+ const char *protocols_properties_protocols_hooks_name)
+{
+ // Is synchronization necessary?
+ TAO_ORB_Core_Static_Resources::instance ()->
+ protocols_properties_protocols_hooks_name_ =
+ protocols_properties_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::set_thread_priority_protocols_hooks (
+ const char *thread_priority_protocols_hooks_name)
+{
+ // Is synchronization necessary?
+ TAO_ORB_Core_Static_Resources::instance ()->
+ thread_priority_protocols_hooks_name_ =
+ thread_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/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index efd682a3ce8..e238ac9d872 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -79,9 +79,14 @@ class TAO_Profile;
class TAO_Endpoint_Selector_Factory;
class TAO_Message_State_Factory;
+
class TAO_Protocols_Hooks;
-class TAO_BiDir_Adapter;
+class TAO_Policy_Protocols_Hooks;
+class TAO_Protocols_Properties_Protocols_Hooks;
+class TAO_Network_Priority_Protocols_Hooks;
+class TAO_Thread_Priority_Protocols_Hooks;
+class TAO_BiDir_Adapter;
class TAO_Flushing_Strategy;
class TAO_Thread_Lane_Resources_Manager;
@@ -323,6 +328,22 @@ 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::policy_protocols_hooks_
+ static void set_policy_protocols_hooks (
+ const char *policy_protocols_hooks_name);
+
+ /// Sets the value of TAO_ORB_Core::protocols_properties_protocols_hooks_
+ static void set_protocols_preperties_protocols_hooks (
+ const char *protocols_properties_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::thread_priority_protocols_hooks_
+ static void set_thread_priority_protocols_hooks (
+ const char *thread_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 +359,21 @@ public:
/// Gets the value of TAO_ORB_Core::protocols_hooks__
TAO_Protocols_Hooks * get_protocols_hooks (void);
+ /// Get the value of the policy protoocols hooks
+ TAO_Policy_Protocols_Hooks * get_policy_protocols_hooks (void);
+
+ /// Get the value of the protocols properties protoocols hooks
+ TAO_Protocols_Properties_Protocols_Hooks *
+ get_protocols_properties_protocols_hooks (void);
+
+ /// Get the value of the network priority protoocols hooks
+ TAO_Network_Priority_Protocols_Hooks *
+ get_network_priority_protocols_hooks (void);
+
+ /// Get the value of the thread priority protoocols hooks
+ TAO_Thread_Priority_Protocols_Hooks *
+ get_thread_priority_protocols_hooks (void);
+
/// Sets the value of TAO_ORB_Core::dynamic_adapter_name_.
static void dynamic_adapter_name (const char *name);
@@ -558,6 +594,19 @@ public:
/// Handle to the factory for protocols_hooks_..
TAO_Protocols_Hooks *protocols_hooks_;
+ /// Handle to the factory for policy protocols hooks
+ TAO_Policy_Protocols_Hooks *policy_protocols_hooks_;
+
+ /// Handle to the factory for protocols properties protocols hooks
+ TAO_Protocols_Properties_Protocols_Hooks
+ *protocols_properties_protocols_hooks_;
+
+ /// Handle to the factory for network priority protocols hooks
+ TAO_Network_Priority_Protocols_Hooks *network_priority_protocols_hooks_;
+
+ /// Handle to the factory for thread priority protocols hooks
+ TAO_Thread_Priority_Protocols_Hooks *thread_priority_protocols_hooks_;
+
/// Obtain the TSS resources of this orb.
TAO_ORB_Core_TSS_Resources* get_tss_resources (void);
@@ -1303,6 +1352,30 @@ public:
*/
ACE_CString protocols_hooks_name_;
+ /**
+ * Name of the policy protocols_hooks that needs to be instantiated.
+ * The default value is "Policy_Protocols_Hooks".
+ */
+ ACE_CString policy_protocols_hooks_name_;
+
+ /**
+ * Name of the protocols_hooks that needs to be instantiated.
+ * The default value is "Protocols_Properties_Protocols_Hooks".
+ */
+ ACE_CString protocols_properties_protocols_hooks_name_;
+
+ /**
+ * Name of the protocols_hooks that needs to be instantiated.
+ * The default value is "Network_Priority_Protocols_Hooks".
+ */
+ ACE_CString network_priority_protocols_hooks_name_;
+
+ /**
+ * Name of the protocols_hooks that needs to be instantiated.
+ * The default value is "Thread_Priority_Protocols_Hooks".
+ */
+ ACE_CString thread_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 ca3defce178..65d51486549 100644
--- a/TAO/tao/ORB_Core.inl
+++ b/TAO/tao/ORB_Core.inl
@@ -75,6 +75,30 @@ TAO_ORB_Core::get_protocols_hooks (void)
return this->protocols_hooks_;
}
+ACE_INLINE TAO_Policy_Protocols_Hooks *
+TAO_ORB_Core::get_policy_protocols_hooks (void)
+{
+ return this->policy_protocols_hooks_;
+}
+
+ACE_INLINE TAO_Protocols_Properties_Protocols_Hooks *
+TAO_ORB_Core::get_protocols_properties_protocols_hooks (void)
+{
+ return this->protocols_properties_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 TAO_Thread_Priority_Protocols_Hooks *
+TAO_ORB_Core::get_thread_priority_protocols_hooks (void)
+{
+ return this->thread_priority_protocols_hooks_;
+}
+
ACE_INLINE CORBA::Boolean
TAO_ORB_Core::service_profile_selection (TAO_MProfile &mprofile,
TAO_Profile *&profile)