diff options
Diffstat (limited to 'TAO/tao/RTPortableServer/RT_Policy_Validator.cpp')
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Policy_Validator.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp index 1d0edd7b526..1bace70d392 100644 --- a/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp +++ b/TAO/tao/RTPortableServer/RT_Policy_Validator.cpp @@ -43,6 +43,9 @@ TAO_POA_RT_Policy_Validator::validate_impl (TAO_Policy_Set &policies, this->validate_thread_pool (policies, ACE_TRY_ENV); ACE_CHECK; + this->validate_lifespan (policies, ACE_TRY_ENV); + ACE_CHECK; + this->validate_server_protocol (policies, ACE_TRY_ENV); ACE_CHECK; @@ -307,6 +310,33 @@ TAO_POA_RT_Policy_Validator::validate_thread_pool (TAO_Policy_Set &policies, } void +TAO_POA_RT_Policy_Validator::validate_lifespan (TAO_Policy_Set &policies, + CORBA::Environment &ACE_TRY_ENV) +{ + // If this POA is using a RTCORBA thread pool, make sure the + // lifespan policy is not persistent since we cannot support it + // right now. + if (this->thread_pool_ != 0) + { + CORBA::Policy_var policy = + policies.get_cached_policy (TAO_CACHED_POLICY_LIFESPAN); + PortableServer::LifespanPolicy_var lifespan_policy = + PortableServer::LifespanPolicy::_narrow (policy.in (), + ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::LifespanPolicyValue lifespan = + lifespan_policy->value (ACE_TRY_ENV); + ACE_CHECK; + + if (lifespan == PortableServer::PERSISTENT) + { + ACE_THROW (PortableServer::POA::InvalidPolicy ()); + } + } +} + +void TAO_POA_RT_Policy_Validator::merge_policies_impl (TAO_Policy_Set &policies, CORBA::Environment &ACE_TRY_ENV) { |