diff options
Diffstat (limited to 'TAO/tao/RTPortableServer/RT_Policy_Validator.cpp')
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Policy_Validator.cpp | 111 |
1 files changed, 42 insertions, 69 deletions
diff --git a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp index 4e11afb2d2e..59351f89c8d 100644 --- a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp +++ b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp @@ -35,16 +35,13 @@ TAO_POA_RT_Policy_Validator::~TAO_POA_RT_Policy_Validator (void) void TAO_POA_RT_Policy_Validator::validate_impl (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { - this->validate_thread_pool (policies ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->validate_thread_pool (policies); - this->validate_server_protocol (policies ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->validate_server_protocol (policies); - this->validate_priorities (policies ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + this->validate_priorities (policies); } CORBA::Boolean @@ -59,15 +56,14 @@ TAO_POA_RT_Policy_Validator::legal_policy_impl (CORBA::PolicyType type) void TAO_POA_RT_Policy_Validator::validate_server_protocol (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { // Make sure we have an endpoint for at least one of the protocols // specified in the RTCORBA::ServerProtocolPolicy. This ensure we // will be able to create non-nil object references. CORBA::Policy_var protocol = policies.get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (CORBA::is_nil (protocol.in ())) { @@ -81,15 +77,13 @@ TAO_POA_RT_Policy_Validator::validate_server_protocol (TAO_Policy_Set &policies if (!CORBA::is_nil (protocol.in ())) { // If so, we'll use that policy. - policies.set_policy (protocol.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + policies.set_policy (protocol.in ()); } } RTCORBA::ServerProtocolPolicy_var server_protocol_policy = RTCORBA::ServerProtocolPolicy::_narrow (protocol.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); TAO_ServerProtocolPolicy *server_protocol = dynamic_cast <TAO_ServerProtocolPolicy *> @@ -154,13 +148,13 @@ TAO_POA_RT_Policy_Validator::validate_server_protocol (TAO_Policy_Set &policies } if (!found) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } } void TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { // Initialize to the default priority/priority model. CORBA::Short priority = @@ -170,23 +164,19 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies CORBA::Policy_var policy = policies.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); RTCORBA::PriorityModelPolicy_var priority_model = RTCORBA::PriorityModelPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (!CORBA::is_nil (priority_model.in ())) { - priority = priority_model->server_priority (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; + priority = priority_model->server_priority (); rt_priority_model = TAO::Portable_Server::Cached_Policies::PriorityModel ( - priority_model->priority_model (ACE_ENV_SINGLE_ARG_PARAMETER)); - ACE_CHECK; + priority_model->priority_model ()); // Check that the priority is in bounds. if (priority < RTCORBA::minPriority @@ -196,7 +186,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies // || priority > RTCORBA::maxPriority ) { - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } } else @@ -205,18 +195,16 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies { if (this->thread_pool_ != 0 && this->thread_pool_->with_lanes ()) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } policy = policies.get_cached_policy (TAO_CACHED_POLICY_RT_PRIORITY_BANDED_CONNECTION - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); RTCORBA::PriorityBandedConnectionPolicy_var priority_bands = RTCORBA::PriorityBandedConnectionPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); TAO_PriorityBandedConnectionPolicy *bands_policy = dynamic_cast<TAO_PriorityBandedConnectionPolicy *> (priority_bands.in ()); @@ -236,14 +224,14 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies { // Checks 0. if (rt_priority_model == TAO::Portable_Server::Cached_Policies::NOT_SPECIFIED) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); RTCORBA::PriorityBands &bands = bands_policy->priority_bands_rep (); // Checks 1. if (bands.length () == 0) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); // Checks 2. for (CORBA::ULong i = 0; i < bands.length (); ++i) @@ -259,7 +247,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies // || bands[i].high > RTCORBA::maxPriority ) { - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } } @@ -278,7 +266,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies } if (!match) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } // @@ -315,7 +303,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies match = 1; } if (!match) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); } // Done with checks. @@ -354,7 +342,7 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies match = 1; } if (!match) - ACE_THROW (PortableServer::POA::InvalidPolicy ()); + throw PortableServer::POA::InvalidPolicy (); // Done with checks. return; @@ -364,24 +352,22 @@ TAO_POA_RT_Policy_Validator::validate_priorities (TAO_Policy_Set &policies void TAO_POA_RT_Policy_Validator::validate_thread_pool (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { this->thread_pool_ = TAO_POA_RT_Policy_Validator::extract_thread_pool (this->orb_core_, policies - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); } void TAO_POA_RT_Policy_Validator::merge_policies_impl (TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { // Check if the user has specified the priority model policy. CORBA::Policy_var priority_model = policies.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (CORBA::is_nil (priority_model.in ())) { @@ -389,22 +375,19 @@ TAO_POA_RT_Policy_Validator::merge_policies_impl (TAO_Policy_Set &policies // at the ORB level. priority_model = this->orb_core_.get_cached_policy (TAO_CACHED_POLICY_PRIORITY_MODEL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (!CORBA::is_nil (priority_model.in ())) { // If so, we'll use that policy. - policies.set_policy (priority_model.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + policies.set_policy (priority_model.in ()); } } // Check if the user has specified the server protocol policy. CORBA::Policy_var server_protocol = policies.get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (CORBA::is_nil (server_protocol.in ())) { @@ -413,22 +396,19 @@ TAO_POA_RT_Policy_Validator::merge_policies_impl (TAO_Policy_Set &policies server_protocol = this->orb_core_.get_cached_policy ( TAO_CACHED_POLICY_RT_SERVER_PROTOCOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (!CORBA::is_nil (server_protocol.in ())) { // If so, we'll use that policy. - policies.set_policy (server_protocol.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + policies.set_policy (server_protocol.in ()); } } // Check if the user has specified the thread pool policy. CORBA::Policy_var thread_pool = policies.get_cached_policy (TAO_CACHED_POLICY_THREADPOOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (CORBA::is_nil (thread_pool.in ())) { @@ -436,14 +416,12 @@ TAO_POA_RT_Policy_Validator::merge_policies_impl (TAO_Policy_Set &policies // the ORB level. thread_pool = this->orb_core_.get_cached_policy (TAO_CACHED_POLICY_THREADPOOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ); if (!CORBA::is_nil (thread_pool.in ())) { // If so, we'll use that policy. - policies.set_policy (thread_pool.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + policies.set_policy (thread_pool.in ()); } } } @@ -552,24 +530,21 @@ TAO_POA_RT_Policy_Validator::server_protocol_policy_from_acceptor_registry (RTCO TAO_Thread_Pool * TAO_POA_RT_Policy_Validator::extract_thread_pool (TAO_ORB_Core &orb_core, TAO_Policy_Set &policies - ACE_ENV_ARG_DECL) + ) { CORBA::Policy_var policy = policies.get_cached_policy (TAO_CACHED_POLICY_THREADPOOL - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + ); RTCORBA::ThreadpoolPolicy_var thread_pool_policy = RTCORBA::ThreadpoolPolicy::_narrow (policy.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + ); if (CORBA::is_nil (thread_pool_policy.in ())) return 0; RTCORBA::ThreadpoolId thread_pool_id = - thread_pool_policy->threadpool (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + thread_pool_policy->threadpool (); // Get the RTORB. CORBA::Object_var object = @@ -577,8 +552,7 @@ TAO_POA_RT_Policy_Validator::extract_thread_pool (TAO_ORB_Core &orb_core, RTCORBA::RTORB_var rt_orb = RTCORBA::RTORB::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + ); TAO_RT_ORB *tao_rt_orb = dynamic_cast <TAO_RT_ORB *> (rt_orb.in ()); @@ -587,8 +561,7 @@ TAO_POA_RT_Policy_Validator::extract_thread_pool (TAO_ORB_Core &orb_core, tao_rt_orb->tp_manager (); TAO_Thread_Pool *thread_pool = - tp_manager.get_threadpool (thread_pool_id ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); + tp_manager.get_threadpool (thread_pool_id); if (thread_pool == 0) ACE_THROW_RETURN (PortableServer::POA::InvalidPolicy (), |