diff options
author | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-02-16 17:01:50 +0000 |
---|---|---|
committer | jai <jai@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-02-16 17:01:50 +0000 |
commit | e8bdb214a9e18bcb40421cebf43e2fb866c4b0a9 (patch) | |
tree | 550012658245542862cb39a9bd8c5c4e83b05c26 | |
parent | fd2082062b20295d15c930b46cc42d93a066bec2 (diff) | |
download | ATCD-e8bdb214a9e18bcb40421cebf43e2fb866c4b0a9.tar.gz |
adding DS library support
-rw-r--r-- | TAO/tao/PortableServer/Network_Priority_Hook.cpp | 49 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Network_Priority_Hook.h | 70 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Cached_Policies.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Cached_Policies.h | 44 | ||||
-rw-r--r-- | TAO/tao/PortableServer/POA_Cached_Policies.inl | 38 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.cpp | 24 | ||||
-rw-r--r-- | TAO/tao/PortableServer/Root_POA.h | 9 |
7 files changed, 238 insertions, 1 deletions
diff --git a/TAO/tao/PortableServer/Network_Priority_Hook.cpp b/TAO/tao/PortableServer/Network_Priority_Hook.cpp new file mode 100644 index 00000000000..7669319307a --- /dev/null +++ b/TAO/tao/PortableServer/Network_Priority_Hook.cpp @@ -0,0 +1,49 @@ +// @(#) $Id$ + +#include "tao/PortableServer/Network_Priority_Hook.h" +#include "tao/PortableServer/Root_POA.h" +#include "tao/PortableServer/POA_Cached_Policies.h" + +ACE_RCSID(PortableServer, + Network_Priority_Hook, + "$Id$") + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +TAO_Network_Priority_Hook::~TAO_Network_Priority_Hook(void) +{ +} + +void +TAO_Network_Priority_Hook::update_network_priority ( + TAO_Root_POA &poa, TAO_POA_Policy_Set &) +{ + poa.cached_policies ().network_priority_model + (TAO::Portable_Server::Cached_Policies::NO_NETWORK_PRIORITY); + poa.cached_policies ().reply_diffserv_codepoint (0); + poa.cached_policies ().request_diffserv_codepoint (0); +} + +void +TAO_Network_Priority_Hook::set_dscp_codepoint ( + TAO_ServerRequest &, TAO_Root_POA &) +{ +} + +int +TAO_Network_Priority_Hook::initialize (void) +{ + return ACE_Service_Config::process_directive + (ace_svc_desc_TAO_Network_Priority_Hook); +} + +TAO_END_VERSIONED_NAMESPACE_DECL + +ACE_FACTORY_DEFINE (TAO_PortableServer, TAO_Network_Priority_Hook) +ACE_STATIC_SVC_DEFINE (TAO_Network_Priority_Hook, + ACE_TEXT ("TAO_Network_Priority_Hook"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_Network_Priority_Hook), + ACE_Service_Type::DELETE_THIS + | ACE_Service_Type::DELETE_OBJ, + 0) diff --git a/TAO/tao/PortableServer/Network_Priority_Hook.h b/TAO/tao/PortableServer/Network_Priority_Hook.h new file mode 100644 index 00000000000..f9300b347dc --- /dev/null +++ b/TAO/tao/PortableServer/Network_Priority_Hook.h @@ -0,0 +1,70 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Network_Priority_Hook.h + * + * $Id$ + * + * Provides default network priority hook for use by the POA + * + * @author Jaiganesh Balasubramanian <jai@dre.vanderbilt.edu> + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_NETWORK_PRIORITY_HOOK_H +#define TAO_NETWORK_PRIORITY_HOOK_H + +#include /**/ "ace/pre.h" + +#include "portableserver_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Versioned_Namespace.h" +#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 +{ +public: + virtual ~TAO_Network_Priority_Hook(void); + + virtual void update_network_priority (TAO_Root_POA& poa, + TAO_POA_Policy_Set& poa_policy_set); + + + virtual void set_dscp_codepoint (TAO_ServerRequest &req, + TAO_Root_POA& poa); + + /// Static initializer ensures the factory is loaded + static int initialize (void); + +}; + + +static int +TAO_Requires_Network_Priority_Hook = +TAO_Network_Priority_Hook::initialize (); + +TAO_END_VERSIONED_NAMESPACE_DECL + +ACE_STATIC_SVC_DECLARE (TAO_Network_Priority_Hook) +ACE_FACTORY_DECLARE (TAO_PortableServer, TAO_Network_Priority_Hook) + +#include /**/ "ace/post.h" + +#endif /* TAO_NETWORK_PRIORITY_HOOK_H */ diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.cpp b/TAO/tao/PortableServer/POA_Cached_Policies.cpp index 561ddb683bb..d531f09197f 100644 --- a/TAO/tao/PortableServer/POA_Cached_Policies.cpp +++ b/TAO/tao/PortableServer/POA_Cached_Policies.cpp @@ -33,7 +33,10 @@ namespace TAO servant_retention_ (::PortableServer::RETAIN), request_processing_ (::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY), priority_model_ (Cached_Policies::NOT_SPECIFIED), - server_priority_ (TAO_INVALID_PRIORITY) + server_priority_ (TAO_INVALID_PRIORITY), + network_priority_model_ (Cached_Policies::NO_NETWORK_PRIORITY), + request_diffserv_codepoint_ (0), + reply_diffserv_codepoint_ (0) { } diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.h b/TAO/tao/PortableServer/POA_Cached_Policies.h index 60465f8238a..5b8caca49d0 100644 --- a/TAO/tao/PortableServer/POA_Cached_Policies.h +++ b/TAO/tao/PortableServer/POA_Cached_Policies.h @@ -50,6 +50,13 @@ namespace TAO NOT_SPECIFIED }; + enum NetworkPriorityModel + { + CLIENT_PROPAGATED_NETWORK_PRIORITY, + SERVER_DECLARED_NETWORK_PRIORITY, + NO_NETWORK_PRIORITY + }; + Cached_Policies (); ~Cached_Policies (void); @@ -72,6 +79,37 @@ namespace TAO PriorityModel priority_model (void) const; CORBA::Short server_priority (void) const; + /// Returns the network priority model that was set using a policy + /// by the server application. + /// + NetworkPriorityModel network_priority_model (void) const; + + /// Returns the request DiffServ codepoint that was set using a policy + /// by the server application. + /// + CORBA::Long request_diffserv_codepoint (void) const; + + /// Returns the reply DiffServ codepoint that was set using a policy + /// by the server application. + /// + CORBA::Long reply_diffserv_codepoint (void) const; + + /// Caches the network priority model that was set using a policy + /// by the server application. + /// + void network_priority_model ( + NetworkPriorityModel network_priority_model); + + /// Caches the request DiffServ codepoint that was set using a policy + /// by the server application. + /// + void request_diffserv_codepoint (CORBA::Long diffserv_codepoint); + + /// Caches the reply DiffServ codepoint that was set using a policy + /// by the server application. + /// + void reply_diffserv_codepoint (CORBA::Long diffserv_codepoint); + void priority_model (PriorityModel priority_model); void server_priority (CORBA::Short priority); void implicit_activation (::PortableServer::ImplicitActivationPolicyValue value); @@ -100,6 +138,12 @@ namespace TAO PriorityModel priority_model_; CORBA::Short server_priority_; + + NetworkPriorityModel network_priority_model_; + + CORBA::Long request_diffserv_codepoint_; + + CORBA::Long reply_diffserv_codepoint_; }; } } diff --git a/TAO/tao/PortableServer/POA_Cached_Policies.inl b/TAO/tao/PortableServer/POA_Cached_Policies.inl index b3699fe3e7d..3bf565f61f6 100644 --- a/TAO/tao/PortableServer/POA_Cached_Policies.inl +++ b/TAO/tao/PortableServer/POA_Cached_Policies.inl @@ -74,6 +74,44 @@ namespace TAO this->server_priority_ = priority; } + ACE_INLINE Cached_Policies::NetworkPriorityModel + Cached_Policies::network_priority_model (void) const + { + return this->network_priority_model_; + } + + ACE_INLINE CORBA::Long + Cached_Policies::request_diffserv_codepoint (void) const + { + return this->request_diffserv_codepoint_; + } + + ACE_INLINE CORBA::Long + Cached_Policies::reply_diffserv_codepoint (void) const + { + return this->reply_diffserv_codepoint_; + } + + ACE_INLINE void + Cached_Policies::network_priority_model ( + NetworkPriorityModel network_priority_model) + { + this->network_priority_model_ = network_priority_model; + } + + ACE_INLINE void + Cached_Policies::request_diffserv_codepoint ( + CORBA::Long diffserv_codepoint) + { + this->request_diffserv_codepoint_ = diffserv_codepoint; + } + + ACE_INLINE void + Cached_Policies::reply_diffserv_codepoint (CORBA::Long diffserv_codepoint) + { + this->reply_diffserv_codepoint_ = diffserv_codepoint; + } + ACE_INLINE void Cached_Policies::implicit_activation (PortableServer::ImplicitActivationPolicyValue value) { diff --git a/TAO/tao/PortableServer/Root_POA.cpp b/TAO/tao/PortableServer/Root_POA.cpp index 0de7c51671d..2ee286db779 100644 --- a/TAO/tao/PortableServer/Root_POA.cpp +++ b/TAO/tao/PortableServer/Root_POA.cpp @@ -32,6 +32,7 @@ #include "tao/PortableServer/ImplicitActivationStrategy.h" #include "tao/PortableServer/ThreadStrategy.h" #include "tao/PortableServer/Acceptor_Filter_Factory.h" +#include "tao/PortableServer/Network_Priority_Hook.h" #include "tao/StringSeqC.h" #include "tao/PortableInterceptorC.h" @@ -203,6 +204,7 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, policies_ (policies), ort_adapter_ (0), adapter_state_ (PortableInterceptor::HOLDING), + network_priority_hook_ (0), #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) @@ -236,6 +238,16 @@ TAO_Root_POA::TAO_Root_POA (const TAO_Root_POA::String &name, // a cache. this->cached_policies_.update (this->policies_); + this->network_priority_hook_ + = ACE_Dynamic_Service<TAO_Network_Priority_Hook>::instance ( + "TAO_Network_Priority_Hook"); + + if (this->network_priority_hook_ != 0) + { + this->network_priority_hook_->update_network_priority ( + *this, this->policies_); + } + #if (TAO_HAS_MINIMUM_POA == 1) // If this is the RootPOA, set the value of the ImplicitActivationPolicy // to IMPLICIT_ACTIVATION since it is impossible to pass the policy @@ -2472,6 +2484,18 @@ TAO_Root_POA::is_servant_active ( is_servant_in_map (servant, wait_occurred_restart_call); } +TAO::Portable_Server::Cached_Policies& +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/TAO/tao/PortableServer/Root_POA.h b/TAO/tao/PortableServer/Root_POA.h index 8a046576f3f..eab87c81a9c 100644 --- a/TAO/tao/PortableServer/Root_POA.h +++ b/TAO/tao/PortableServer/Root_POA.h @@ -74,6 +74,7 @@ class TAO_Acceptor_Filter_Factory; class TAO_POAManager_Factory; #endif +class TAO_Network_Priority_Hook; class TAO_Acceptor_Registry; class TAO_IORInfo; class TAO_Regular_POA; @@ -338,6 +339,12 @@ public: /// ORB Core for POA. TAO_ORB_Core &orb_core (void) const; + /// 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); @@ -801,6 +808,8 @@ protected: TAO::Portable_Server::Cached_Policies cached_policies_; + TAO_Network_Priority_Hook *network_priority_hook_; + TAO::Portable_Server::Active_Policy_Strategies active_policy_strategies_; #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) |