Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

TAO_Policy_Validator Class Reference

An abstract class for plugging in different Policy Validator mechanisms. More...

#include <Policy_Validator.h>

Collaboration diagram for TAO_Policy_Validator:

Collaboration graph
[legend]
List of all members.

Public Methods

 TAO_Policy_Validator (TAO_ORB_Core &orb_core)
 Constructor. More...

virtual ~TAO_Policy_Validator (void)
 Destructor. More...

void validate (TAO_Policy_Set &policies ACE_ENV_ARG_DECL)
void merge_policies (TAO_Policy_Set &policies ACE_ENV_ARG_DECL)
CORBA::Boolean legal_policy (CORBA::PolicyType type)
void add_validator (TAO_Policy_Validator *validator)

Protected Methods

virtual void validate_impl (TAO_Policy_Set &policies ACE_ENV_ARG_DECL)=0
virtual void merge_policies_impl (TAO_Policy_Set &policies ACE_ENV_ARG_DECL)=0
virtual CORBA::Boolean legal_policy_impl (CORBA::PolicyType type)=0

Protected Attributes

TAO_ORB_Coreorb_core_

Private Attributes

TAO_Policy_Validator * next_

Static Private Attributes

TAO_Policy_Validator * last_ = 0

Detailed Description

An abstract class for plugging in different Policy Validator mechanisms.

This class was moved form the PortableServer library. The Portable Serever library used this abstraction to add policy validators to for the policies in the POA. This class seems so much useful for passing policy information between different loaded libraries.

Definition at line 43 of file Policy_Validator.h.


Constructor & Destructor Documentation

TAO_Policy_Validator::TAO_Policy_Validator TAO_ORB_Core   orb_core
 

Constructor.

Definition at line 13 of file Policy_Validator.cpp.

00014   : orb_core_ (orb_core),
00015     next_ (0)
00016 {
00017   // No-Op.
00018 }

TAO_Policy_Validator::~TAO_Policy_Validator void    [virtual]
 

Destructor.

Definition at line 20 of file Policy_Validator.cpp.

References last_, and next_.

00021 {
00022   if (this == this->last_)
00023     this-> last_ = 0;
00024   if (this->next_)
00025     delete this->next_;
00026 }


Member Function Documentation

void TAO_Policy_Validator::add_validator TAO_Policy_Validator *    validator
 

Adds a validator to the "chain of validators". The TAO_POA_Policy_Validator implements something that looks like a chain of responsability in which different member of the chain have the responsability of validating a given set of policies.

Definition at line 29 of file Policy_Validator.cpp.

References ACE_DEBUG, ACE_LIB_TEXT, last_, LM_DEBUG, and next_.

00030 {
00031   if (this->last_ == 0)
00032     {
00033       this->last_ = this->next_ = validator;
00034     }
00035   else
00036     {
00037       if (this->last_ == validator)
00038         {
00039           if (TAO_debug_level > 3)
00040             ACE_DEBUG ((LM_DEBUG,
00041                         ACE_LIB_TEXT ("(%P|%t) Skipping validator [0x%x] ")
00042                         ACE_LIB_TEXT ("since it would create a circular list \n"),
00043                         validator));
00044 
00045           return;
00046         }
00047       this->last_ = this->last_->next_ = validator;
00048 
00049     }
00050 }

CORBA::Boolean TAO_Policy_Validator::legal_policy CORBA::PolicyType    type
 

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.

Definition at line 82 of file Policy_Validator.cpp.

References legal_policy_impl, and next_.

00083 {
00084   return (this->legal_policy_impl (type) ||
00085           ((this->next_ != 0) && this->next_->legal_policy_impl (type)));
00086 }

virtual CORBA::Boolean TAO_Policy_Validator::legal_policy_impl CORBA::PolicyType    type [protected, pure virtual]
 

Referenced by legal_policy.

void TAO_Policy_Validator::merge_policies TAO_Policy_Set &policies    ACE_ENV_ARG_DECL
 

Add/merge policies.

Definition at line 68 of file Policy_Validator.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, merge_policies_impl, and next_.

00070 {
00071   this->merge_policies_impl (policies ACE_ENV_ARG_PARAMETER);
00072   ACE_CHECK;
00073 
00074   if (this->next_ != 0)
00075     {
00076       this->next_->merge_policies (policies ACE_ENV_ARG_PARAMETER);
00077       ACE_CHECK;
00078     }
00079 }

virtual void TAO_Policy_Validator::merge_policies_impl TAO_Policy_Set &policies    ACE_ENV_ARG_DECL [protected, pure virtual]
 

Referenced by merge_policies.

void TAO_Policy_Validator::validate TAO_Policy_Set &policies    ACE_ENV_ARG_DECL
 

Validate that the policies in the specified set are consistent and legal. Throw an appropriate exception if that is not the case.

Definition at line 54 of file Policy_Validator.cpp.

References ACE_CHECK, ACE_ENV_ARG_DECL, ACE_ENV_ARG_PARAMETER, next_, and validate_impl.

00056 {
00057   this->validate_impl (policies ACE_ENV_ARG_PARAMETER);
00058   ACE_CHECK;
00059 
00060   if (this->next_ != 0)
00061     {
00062       this->next_->validate (policies ACE_ENV_ARG_PARAMETER);
00063       ACE_CHECK;
00064     }
00065 }

virtual void TAO_Policy_Validator::validate_impl TAO_Policy_Set &policies    ACE_ENV_ARG_DECL [protected, pure virtual]
 

Referenced by validate.


Member Data Documentation

TAO_Policy_Validator * TAO_Policy_Validator::last_ = 0 [static, private]
 

Definition at line 11 of file Policy_Validator.cpp.

Referenced by add_validator, and ~TAO_Policy_Validator.

TAO_Policy_Validator* TAO_Policy_Validator::next_ [private]
 

Definition at line 96 of file Policy_Validator.h.

Referenced by add_validator, legal_policy, merge_policies, validate, and ~TAO_Policy_Validator.

TAO_ORB_Core& TAO_Policy_Validator::orb_core_ [protected]
 

Definition at line 93 of file Policy_Validator.h.


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:36:51 2003 for TAO by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002