#include <Default_Policy_Validator.h>
Inheritance diagram for TAO_POA_Default_Policy_Validator:
Public Member Functions | |
TAO_POA_Default_Policy_Validator (TAO_ORB_Core &orb_core) | |
Constructor. | |
~TAO_POA_Default_Policy_Validator (void) | |
Destructor. | |
Protected Member Functions | |
void | validate_impl (TAO_Policy_Set &policies) |
void | merge_policies_impl (TAO_Policy_Set &policies) |
Add/merge policies. | |
virtual CORBA::Boolean | legal_policy_impl (CORBA::PolicyType type) |
|
Constructor.
Definition at line 16 of file Default_Policy_Validator.cpp.
00018 : TAO_Policy_Validator (orb_core) 00019 { 00020 } |
|
Destructor.
Definition at line 22 of file Default_Policy_Validator.cpp.
00023 { 00024 } |
|
Return whether the specified policy type is legal for the current configuration. This is needed since the user can potentially specify policies that are unknown to an validate () routine, and these need to be caught. Implements TAO_Policy_Validator. Definition at line 126 of file Default_Policy_Validator.cpp. References TAO::PolicyFactory_Registry_Adapter::factory_exists(), and TAO_ORB_Core::policy_factory_registry().
00127 { 00128 // Check known POA policies, or if given PolicyType has a 00129 // corresponding PolicyFactory. The PolicyFactory check is mandated 00130 // by the CORBA specification. 00131 return 00132 ( 00133 # if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) 00134 type == PortableServer::THREAD_POLICY_ID || 00135 # endif 00136 # if ! defined (CORBA_E_MICRO) 00137 type == PortableServer::LIFESPAN_POLICY_ID || 00138 type == PortableServer::ID_UNIQUENESS_POLICY_ID || 00139 type == PortableServer::ID_ASSIGNMENT_POLICY_ID || 00140 # endif 00141 # if ! defined (CORBA_E_COMPACT) && ! defined (CORBA_E_MICRO) 00142 type == PortableServer::IMPLICIT_ACTIVATION_POLICY_ID || 00143 type == PortableServer::SERVANT_RETENTION_POLICY_ID || 00144 type == PortableServer::REQUEST_PROCESSING_POLICY_ID || 00145 # endif 00146 (this->orb_core_.policy_factory_registry () != 0 && 00147 this->orb_core_.policy_factory_registry ()->factory_exists (type))); 00148 } |
|
Add/merge policies.
Implements TAO_Policy_Validator. Definition at line 151 of file Default_Policy_Validator.cpp.
00154 { 00155 } |
|
Validate that the policies in the specified set are consistent and legal. Throw an appropriate exception if that is not the case. Implements TAO_Policy_Validator. Definition at line 27 of file Default_Policy_Validator.cpp. References CORBA::Policy::_narrow(), ACE_CHECK, ACE_ENV_ARG_NOT_USED, ACE_ENV_ARG_PARAMETER, ACE_ENV_SINGLE_ARG_PARAMETER, ACE_THROW, TAO_CACHED_POLICY_ID_ASSIGNMENT, TAO_CACHED_POLICY_ID_UNIQUENESS, TAO_CACHED_POLICY_IMPLICIT_ACTIVATION, TAO_CACHED_POLICY_REQUEST_PROCESSING, and TAO_CACHED_POLICY_SERVANT_RETENTION.
00029 { 00030 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) 00031 CORBA::Policy_var policy = 00032 policies.get_cached_policy (TAO_CACHED_POLICY_SERVANT_RETENTION 00033 ACE_ENV_ARG_PARAMETER); 00034 ACE_CHECK; 00035 00036 PortableServer::ServantRetentionPolicy_var srp = 00037 PortableServer::ServantRetentionPolicy::_narrow (policy.in () 00038 ACE_ENV_ARG_PARAMETER); 00039 ACE_CHECK; 00040 PortableServer::ServantRetentionPolicyValue servant_retention = 00041 srp->value (ACE_ENV_SINGLE_ARG_PARAMETER); 00042 ACE_CHECK; 00043 00044 policy = 00045 policies.get_cached_policy (TAO_CACHED_POLICY_REQUEST_PROCESSING 00046 ACE_ENV_ARG_PARAMETER); 00047 ACE_CHECK; 00048 00049 PortableServer::RequestProcessingPolicy_var rpp = 00050 PortableServer::RequestProcessingPolicy::_narrow (policy.in () 00051 ACE_ENV_ARG_PARAMETER); 00052 ACE_CHECK; 00053 PortableServer::RequestProcessingPolicyValue request_processing = 00054 rpp->value (ACE_ENV_SINGLE_ARG_PARAMETER); 00055 ACE_CHECK; 00056 00057 // The NON_RETAIN policy requires either the USE_DEFAULT_SERVANT or 00058 // USE_SERVANT_MANAGER policies. 00059 if (servant_retention == PortableServer::NON_RETAIN) 00060 if (request_processing != PortableServer::USE_SERVANT_MANAGER && 00061 request_processing != PortableServer::USE_DEFAULT_SERVANT) 00062 ACE_THROW (PortableServer::POA::InvalidPolicy ()); 00063 00064 // USE_ACTIVE_OBJECT_MAP_ONLY requires the RETAIN policy. 00065 if (request_processing == PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY) 00066 if (servant_retention != PortableServer::RETAIN) 00067 ACE_THROW (PortableServer::POA::InvalidPolicy ()); 00068 00069 policy = 00070 policies.get_cached_policy (TAO_CACHED_POLICY_ID_UNIQUENESS 00071 ACE_ENV_ARG_PARAMETER); 00072 00073 ACE_CHECK; 00074 00075 PortableServer::IdUniquenessPolicy_var iup = 00076 PortableServer::IdUniquenessPolicy::_narrow (policy.in () 00077 ACE_ENV_ARG_PARAMETER); 00078 ACE_CHECK; 00079 PortableServer::IdUniquenessPolicyValue id_uniqueness = 00080 iup->value (ACE_ENV_SINGLE_ARG_PARAMETER); 00081 ACE_CHECK; 00082 00083 policy = 00084 policies.get_cached_policy (TAO_CACHED_POLICY_IMPLICIT_ACTIVATION 00085 ACE_ENV_ARG_PARAMETER); 00086 ACE_CHECK; 00087 00088 PortableServer::ImplicitActivationPolicy_var iap = 00089 PortableServer::ImplicitActivationPolicy::_narrow (policy.in () 00090 ACE_ENV_ARG_PARAMETER); 00091 ACE_CHECK; 00092 PortableServer::ImplicitActivationPolicyValue implicit_activation = 00093 iap->value (ACE_ENV_SINGLE_ARG_PARAMETER); 00094 ACE_CHECK; 00095 00096 policy = 00097 policies.get_cached_policy (TAO_CACHED_POLICY_ID_ASSIGNMENT 00098 ACE_ENV_ARG_PARAMETER); 00099 ACE_CHECK; 00100 00101 PortableServer::IdAssignmentPolicy_var idap = 00102 PortableServer::IdAssignmentPolicy::_narrow (policy.in () 00103 ACE_ENV_ARG_PARAMETER); 00104 ACE_CHECK; 00105 PortableServer::IdAssignmentPolicyValue id_assignment = 00106 idap->value (ACE_ENV_SINGLE_ARG_PARAMETER); 00107 ACE_CHECK; 00108 00109 // USE_DEFAULT_SERVANT requires the MULTIPLE_ID policy. 00110 if (request_processing == PortableServer::USE_DEFAULT_SERVANT) 00111 if (id_uniqueness != PortableServer::MULTIPLE_ID) 00112 ACE_THROW (PortableServer::POA::InvalidPolicy ()); 00113 00114 // IMPLICIT_ACTIVATION requires the SYSTEM_ID and RETAIN policies. 00115 if (implicit_activation == PortableServer::IMPLICIT_ACTIVATION) 00116 if (servant_retention != PortableServer::RETAIN || 00117 id_assignment != PortableServer::SYSTEM_ID) 00118 ACE_THROW (PortableServer::POA::InvalidPolicy ()); 00119 #else /* TAO_HAS_MINIMUM_POA == 0 */ 00120 ACE_UNUSED_ARG (policies); 00121 ACE_ENV_ARG_NOT_USED; // FUZZ: ignore check_for_ace_check 00122 #endif /* TAO_HAS_MINIMUM_POA == 0 */ 00123 } |