summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-02 20:26:44 +0000
committerjai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-02-02 20:26:44 +0000
commit814ec8e76e34c88755ff8f9017552e75b3d70b3a (patch)
treed19de2b6d98bdead7db95db6f1d7d166fb192e41
parent706a47ab5f24fbad1d7df30fb14dd26c04907591 (diff)
downloadATCD-814ec8e76e34c88755ff8f9017552e75b3d70b3a.tar.gz
adding DS library
-rw-r--r--modules/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp30
-rw-r--r--modules/TAO/tao/PortableServer/Network_Priority_Hook.cpp6
-rw-r--r--modules/TAO/tao/PortableServer/Network_Priority_Hook.h6
-rw-r--r--modules/TAO/tao/PortableServer/Root_POA.cpp6
-rw-r--r--modules/TAO/tao/PortableServer/Root_POA.h3
5 files changed, 25 insertions, 26 deletions
diff --git a/modules/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp b/modules/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp
index 2b46732545a..8c860f1d806 100644
--- a/modules/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp
+++ b/modules/TAO/tao/PortableServer/Default_Servant_Dispatcher.cpp
@@ -2,6 +2,7 @@
#include "tao/PortableServer/Default_Servant_Dispatcher.h"
#include "tao/PortableServer/Root_POA.h"
+#include "tao/PortableServer/Network_Priority_Hook.h"
#include "tao/Service_Context.h"
#include "tao/TAO_Server_Request.h"
#include "tao/Connection_Handler.h"
@@ -50,34 +51,11 @@ TAO_Default_Servant_Dispatcher::pre_invoke_remote_request (
TAO_ServerRequest &req,
TAO::Portable_Server::Servant_Upcall::Pre_Invoke_State &)
{
- TAO_Service_Context &request_service_context =
- req.request_service_context ();
-
- CORBA::Long dscp_codepoint;
+ CORBA::Long dscp_codepoint = poa.network_priority_hook ()->
+ get_dscp_codepoint (req, poa);
TAO_Connection_Handler *connection_handler =
req.transport ()->connection_handler ();
-
- TAO_Network_Priority_Protocols_Hooks *nph =
- poa.orb_core ().get_network_priority_protocols_hooks ();
-
- TAO::Portable_Server::Cached_Policies::NetworkPriorityModel npm =
- poa.cached_policies ().network_priority_model ();
-
- if (npm == TAO::Portable_Server::Cached_Policies::
- CLIENT_PROPAGATED_NETWORK_PRIORITY)
- {
- dscp_codepoint = nph->get_dscp_codepoint (request_service_context);
- connection_handler->set_dscp_codepoint (dscp_codepoint);
- }
- else if (npm == TAO::Portable_Server::Cached_Policies::
- SERVER_DECLARED_NETWORK_PRIORITY)
- {
- dscp_codepoint = poa.cached_policies ().reply_diffserv_codepoint ();
- }
- else
- {
- // no server side network priority policy defined.
- }
+ connection_handler->set_dscp_codepoint (dscp_codepoint);
}
void
diff --git a/modules/TAO/tao/PortableServer/Network_Priority_Hook.cpp b/modules/TAO/tao/PortableServer/Network_Priority_Hook.cpp
index b60ec81d91f..12ceaf6dd09 100644
--- a/modules/TAO/tao/PortableServer/Network_Priority_Hook.cpp
+++ b/modules/TAO/tao/PortableServer/Network_Priority_Hook.cpp
@@ -24,6 +24,12 @@ TAO_Network_Priority_Hook::update_network_priority (
poa.cached_policies ().request_diffserv_codepoint (0);
}
+CORBA::Long
+TAO_Network_Priority_Hook::get_dscp_codepoint (
+ TAO_ServerRequest &, TAO_Root_POA &)
+{
+ return 0;
+}
int
TAO_Network_Priority_Hook::initialize (void)
diff --git a/modules/TAO/tao/PortableServer/Network_Priority_Hook.h b/modules/TAO/tao/PortableServer/Network_Priority_Hook.h
index 6e3db4cf31f..a75ef319ef1 100644
--- a/modules/TAO/tao/PortableServer/Network_Priority_Hook.h
+++ b/modules/TAO/tao/PortableServer/Network_Priority_Hook.h
@@ -29,11 +29,13 @@
#include "tao/orbconf.h"
#include "ace/Service_Object.h"
#include "ace/Service_Config.h"
+#include "tao/Basic_Types.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_POA_Policy_Set;
class TAO_Root_POA;
+class TAO_ServerRequest;
class TAO_PortableServer_Export TAO_Network_Priority_Hook
: public ACE_Service_Object
@@ -44,6 +46,10 @@ public:
virtual void update_network_priority (TAO_Root_POA& poa,
TAO_POA_Policy_Set& poa_policy_set);
+
+ virtual CORBA::Long get_dscp_codepoint (TAO_ServerRequest &req,
+ TAO_Root_POA& poa);
+
/// Static initializer ensures the factory is loaded
static int initialize (void);
diff --git a/modules/TAO/tao/PortableServer/Root_POA.cpp b/modules/TAO/tao/PortableServer/Root_POA.cpp
index 1f1b1952237..9cc7337aca5 100644
--- a/modules/TAO/tao/PortableServer/Root_POA.cpp
+++ b/modules/TAO/tao/PortableServer/Root_POA.cpp
@@ -2651,6 +2651,12 @@ TAO_Root_POA::cached_policies (void)
return this->cached_policies_;
}
+TAO_Network_Priority_Hook*
+TAO_Root_POA::network_priority_hook (void)
+{
+ return this->network_priority_hook_;
+}
+
TAO::Portable_Server::Cached_Policies::PriorityModel
TAO_Root_POA::priority_model (void) const
{
diff --git a/modules/TAO/tao/PortableServer/Root_POA.h b/modules/TAO/tao/PortableServer/Root_POA.h
index 3cec040e7a1..7f50f39c6a7 100644
--- a/modules/TAO/tao/PortableServer/Root_POA.h
+++ b/modules/TAO/tao/PortableServer/Root_POA.h
@@ -408,6 +408,9 @@ public:
// obtain a reference to the cached_profiles
TAO::Portable_Server::Cached_Policies& cached_policies (void);
+ // obtain a handle to the network priority hooks
+ TAO_Network_Priority_Hook* network_priority_hook (void);
+
TAO::Portable_Server::Cached_Policies::PriorityModel priority_model (void) const;
CORBA::Boolean cleanup_in_progress (void);