summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-06-26 23:22:27 +0000
committeryamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2002-06-26 23:22:27 +0000
commit153a9f23691da174c79c824d3cb7ab627dd046c6 (patch)
tree897ed779c28aedf89e40e6ce308d5447ee8aa385
parentf306a98d2d0f0de9e63d2bb7b638cb976d80e553 (diff)
downloadATCD-153a9f23691da174c79c824d3cb7ab627dd046c6.tar.gz
ChangelogTag: Wed June 26 2:09:00 2002 Yamuna Krishnamurthy <yamuna@oomworks.com>
-rw-r--r--TAO/tao/RTCORBA/RT_ORB.cpp6
-rw-r--r--TAO/tao/RTCORBA/RT_ORB.h3
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.cpp36
-rw-r--r--TAO/tao/RTCORBA/RT_ORBInitializer.h9
-rw-r--r--TAO/tao/RTCORBA/RT_ORB_Loader.cpp15
-rw-r--r--TAO/tao/RTCORBA/RT_Policy_i.cpp30
-rw-r--r--TAO/tao/RTCORBA/RT_Policy_i.h13
7 files changed, 105 insertions, 7 deletions
diff --git a/TAO/tao/RTCORBA/RT_ORB.cpp b/TAO/tao/RTCORBA/RT_ORB.cpp
index d3ca63fd5fb..2c594b9a3d3 100644
--- a/TAO/tao/RTCORBA/RT_ORB.cpp
+++ b/TAO/tao/RTCORBA/RT_ORB.cpp
@@ -234,7 +234,8 @@ TAO_RT_ORB::create_tcp_protocol_properties (CORBA::Long send_buffer_size,
CORBA::Long recv_buffer_size,
CORBA::Boolean keep_alive,
CORBA::Boolean dont_route,
- CORBA::Boolean no_delay
+ CORBA::Boolean no_delay,
+ CORBA::Boolean enable_network_priority
ACE_ENV_ARG_DECL)
ACE_THROW_SPEC ((CORBA::SystemException ))
{
@@ -244,7 +245,8 @@ TAO_RT_ORB::create_tcp_protocol_properties (CORBA::Long send_buffer_size,
recv_buffer_size,
keep_alive,
dont_route,
- no_delay),
+ no_delay,
+ enable_network_priority),
CORBA::NO_MEMORY (TAO_DEFAULT_MINOR_CODE,
CORBA::COMPLETED_NO));
ACE_CHECK_RETURN (RTCORBA::TCPProtocolProperties::_nil ());
diff --git a/TAO/tao/RTCORBA/RT_ORB.h b/TAO/tao/RTCORBA/RT_ORB.h
index fee075c7569..70603bc5f80 100644
--- a/TAO/tao/RTCORBA/RT_ORB.h
+++ b/TAO/tao/RTCORBA/RT_ORB.h
@@ -149,7 +149,8 @@ public:
CORBA::Long recv_buffer_size,
CORBA::Boolean keep_alive,
CORBA::Boolean dont_route,
- CORBA::Boolean no_delay
+ CORBA::Boolean no_delay,
+ CORBA::Boolean enable_network_priority
ACE_ENV_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException ));
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
index 02660a31634..f98b054f4ca 100644
--- a/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
+++ b/TAO/tao/RTCORBA/RT_ORBInitializer.cpp
@@ -13,6 +13,7 @@ ACE_RCSID (TAO, RT_ORBInitializer, "$Id$")
#include "RT_Policy_i.h"
#include "RT_Protocols_Hooks.h"
#include "Priority_Mapping_Manager.h"
+#include "Network_Priority_Mapping_Manager.h"
#include "tao/Exception.h"
#include "tao/ORB_Core.h"
#include "tao/ORBInitInfo.h"
@@ -22,6 +23,7 @@ ACE_RCSID (TAO, RT_ORBInitializer, "$Id$")
#include "Continuous_Priority_Mapping.h"
#include "Linear_Priority_Mapping.h"
#include "Direct_Priority_Mapping.h"
+#include "Linear_Network_Priority_Mapping.h"
#include "RT_ORB.h"
#include "RT_Current.h"
#include "RT_Thread_Lane_Resources_Manager.h"
@@ -33,9 +35,11 @@ static const char *rt_poa_factory_name = "TAO_RT_POA";
static const char *rt_poa_factory_directive = "dynamic TAO_RT_POA Service_Object * TAO_RTPortableServer:_make_TAO_RT_Object_Adapter_Factory()";
TAO_RT_ORBInitializer::TAO_RT_ORBInitializer (int priority_mapping_type,
+ int network_priority_mapping_type,
long sched_policy,
long scope_policy)
: priority_mapping_type_ (priority_mapping_type),
+ network_priority_mapping_type_ (network_priority_mapping_type),
sched_policy_ (sched_policy),
scope_policy_ (scope_policy)
{
@@ -117,12 +121,44 @@ TAO_RT_ORBInitializer::pre_init (
CORBA::COMPLETED_NO));
ACE_CHECK;
+
TAO_Priority_Mapping_Manager_var safe_manager = manager;
info->register_initial_reference ("PriorityMappingManager",
manager
ACE_ENV_ARG_PARAMETER);
ACE_CHECK;
+
+ // Create the initial priority mapping instance.
+ TAO_Network_Priority_Mapping *npm;
+ switch (this->network_priority_mapping_type_)
+ {
+ default:
+ case TAO_NETWORK_PRIORITY_MAPPING_LINEAR:
+ ACE_NEW (npm,
+ TAO_Linear_Network_Priority_Mapping (sched_policy));
+ break;
+ }
+
+ // Set the Priority_Mapping_Manager
+ TAO_Network_Priority_Mapping_Manager *network_manager = 0;
+
+ ACE_NEW_THROW_EX (network_manager,
+ TAO_Network_Priority_Mapping_Manager (npm),
+ CORBA::NO_MEMORY (
+ CORBA::SystemException::_tao_minor_code (
+ TAO_DEFAULT_MINOR_CODE,
+ ENOMEM),
+ CORBA::COMPLETED_NO));
+ ACE_CHECK;
+
+
+ TAO_Network_Priority_Mapping_Manager_var safe_network_manager = network_manager;
+
+ info->register_initial_reference ("NetworkPriorityMappingManager",
+ network_manager
+ ACE_ENV_ARG_PARAMETER);
+ ACE_CHECK;
// @@ This is busted. TAO_ORBInitInfo should do proper reference
// counting.
diff --git a/TAO/tao/RTCORBA/RT_ORBInitializer.h b/TAO/tao/RTCORBA/RT_ORBInitializer.h
index 344edd06fa9..f03b0ff864d 100644
--- a/TAO/tao/RTCORBA/RT_ORBInitializer.h
+++ b/TAO/tao/RTCORBA/RT_ORBInitializer.h
@@ -50,7 +50,13 @@ public:
TAO_PRIORITY_MAPPING_DIRECT
};
+ enum
+ {
+ TAO_NETWORK_PRIORITY_MAPPING_LINEAR
+ };
+
TAO_RT_ORBInitializer (int priority_mapping_type,
+ int network_priority_mapping_type,
long sched_policy,
long scope_policy);
@@ -79,6 +85,9 @@ private:
/// Priority mapping type.
int priority_mapping_type_;
+ /// Network Priority mapping type.
+ int network_priority_mapping_type_;
+
/// Scheduling policy.
long sched_policy_;
diff --git a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
index 470940760b3..9e31843a42b 100644
--- a/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
+++ b/TAO/tao/RTCORBA/RT_ORB_Loader.cpp
@@ -33,6 +33,7 @@ TAO_RT_ORB_Loader::init (int argc,
// Set defaults.
int priority_mapping_type = TAO_RT_ORBInitializer::TAO_PRIORITY_MAPPING_DIRECT;
+ int network_priority_mapping_type = TAO_RT_ORBInitializer::TAO_NETWORK_PRIORITY_MAPPING_LINEAR;
long sched_policy = THR_SCHED_DEFAULT;
long scope_policy = THR_SCOPE_PROCESS;
int curarg = 0;
@@ -108,6 +109,19 @@ TAO_RT_ORB_Loader::init (int argc,
name));
}
}
+ else if (ACE_OS::strcasecmp (argv[curarg],
+ ACE_LIB_TEXT("-ORBNetworkPriorityMapping")) == 0)
+ {
+ curarg++;
+ if (curarg < argc)
+ {
+ ACE_TCHAR* name = argv[curarg];
+
+ if (ACE_OS::strcasecmp (name,
+ ACE_LIB_TEXT("linear")) == 0)
+ network_priority_mapping_type = TAO_RT_ORBInitializer::TAO_NETWORK_PRIORITY_MAPPING_LINEAR;
+ }
+ }
else
{
if (TAO_debug_level > 0)
@@ -129,6 +143,7 @@ TAO_RT_ORB_Loader::init (int argc,
/// Register the RTCORBA ORBInitializer.
ACE_NEW_THROW_EX (temp_orb_initializer,
TAO_RT_ORBInitializer (priority_mapping_type,
+ network_priority_mapping_type,
sched_policy,
scope_policy),
CORBA::NO_MEMORY (
diff --git a/TAO/tao/RTCORBA/RT_Policy_i.cpp b/TAO/tao/RTCORBA/RT_Policy_i.cpp
index d0104fcfb73..dfb62baaa8d 100644
--- a/TAO/tao/RTCORBA/RT_Policy_i.cpp
+++ b/TAO/tao/RTCORBA/RT_Policy_i.cpp
@@ -331,12 +331,14 @@ TAO_TCP_Properties::TAO_TCP_Properties (CORBA::Long send_buffer_size,
CORBA::Long recv_buffer_size,
CORBA::Boolean keep_alive,
CORBA::Boolean dont_route,
- CORBA::Boolean no_delay)
+ CORBA::Boolean no_delay,
+ CORBA::Boolean enable_network_priority)
: send_buffer_size_ (send_buffer_size),
recv_buffer_size_ (recv_buffer_size),
keep_alive_ (keep_alive),
dont_route_ (dont_route),
- no_delay_ (no_delay)
+ no_delay_ (no_delay),
+ enable_network_priority_ (enable_network_priority)
{
}
@@ -418,6 +420,21 @@ TAO_TCP_Properties::no_delay (CORBA::Boolean no_delay
this->no_delay_ = no_delay;
}
+CORBA::Boolean
+TAO_TCP_Properties::enable_network_priority (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ return this->enable_network_priority_;
+}
+
+void
+TAO_TCP_Properties::enable_network_priority (CORBA::Boolean enable
+ ACE_ENV_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ this->enable_network_priority_ = enable;
+}
+
///////////////////////////////////////////////////////
// Method for serialization support.
@@ -654,6 +671,7 @@ TAO_ServerProtocolPolicy::hook (TAO_ORB_Core *orb_core,
int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type)
{
RTCORBA::ProtocolProperties_var properties =
@@ -785,6 +803,9 @@ TAO_ServerProtocolPolicy::hook (TAO_ORB_Core *orb_core,
ACE_TRY_CHECK;
no_delay = tcp_properties->no_delay (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
+ enable_network_priority =
+ tcp_properties->enable_network_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ ACE_TRY_CHECK;
}
if (ACE_OS::strcmp (protocol_type, "uiop") == 0)
@@ -899,6 +920,7 @@ TAO_ClientProtocolPolicy::hook (TAO_ORB_Core *orb_core,
int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type)
{
RTCORBA::ProtocolProperties_var properties =
@@ -1028,7 +1050,9 @@ TAO_ClientProtocolPolicy::hook (TAO_ORB_Core *orb_core,
ACE_TRY_CHECK;
no_delay = tcp_properties->no_delay (ACE_ENV_SINGLE_ARG_PARAMETER);
ACE_TRY_CHECK;
- }
+ enable_network_priority =
+ tcp_properties->enable_network_priority (ACE_ENV_SINGLE_ARG_PARAMETER);
+ }
if (ACE_OS::strcmp (protocol_type, "uiop") == 0)
{
diff --git a/TAO/tao/RTCORBA/RT_Policy_i.h b/TAO/tao/RTCORBA/RT_Policy_i.h
index bafe86a0ca5..c523d0c766d 100644
--- a/TAO/tao/RTCORBA/RT_Policy_i.h
+++ b/TAO/tao/RTCORBA/RT_Policy_i.h
@@ -320,6 +320,7 @@ public:
int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char *protocol_type);
// Return the cached policy type for this policy.
@@ -382,6 +383,7 @@ public:
int &send_buffer_size,
int &recv_buffer_size,
int &no_delay,
+ int &enable_network_priority,
const char* protocol_type);
virtual void destroy (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
@@ -438,7 +440,8 @@ public:
ACE_DEFAULT_MAX_SOCKET_BUFSIZ,
CORBA::Boolean keep_alive = 1,
CORBA::Boolean dont_route = 0,
- CORBA::Boolean no_delay = 1);
+ CORBA::Boolean no_delay = 1,
+ CORBA::Boolean enable_network_priority = 0);
virtual CORBA::Long send_buffer_size (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
ACE_THROW_SPEC ((CORBA::SystemException));
@@ -481,6 +484,13 @@ public:
/// This method reads the object state from a CDR representation.
virtual CORBA::Boolean _tao_decode (TAO_InputCDR &in_cdr);
+
+ virtual CORBA::Boolean enable_network_priority (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
+
+ virtual void enable_network_priority (CORBA::Boolean enable
+ ACE_ENV_ARG_DECL_WITH_DEFAULTS)
+ ACE_THROW_SPEC ((CORBA::SystemException));
protected:
@@ -496,6 +506,7 @@ private:
CORBA::Boolean keep_alive_;
CORBA::Boolean dont_route_;
CORBA::Boolean no_delay_;
+ CORBA::Boolean enable_network_priority_;
};
//*************************************************************************