00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file PG_Default_Property_Validator.h 00006 * 00007 * PG_Default_Property_Validator.h,v 1.9 2006/03/14 06:14:34 jtc Exp 00008 * 00009 * @author Ossama Othman <ossama@uci.edu> 00010 */ 00011 //============================================================================= 00012 00013 #ifndef TAO_PG_DEFAULT_PROPERTY_VALIDATOR_H 00014 #define TAO_PG_DEFAULT_PROPERTY_VALIDATOR_H 00015 00016 #include /**/ "ace/pre.h" 00017 00018 #include "orbsvcs/PortableGroup/portablegroup_export.h" 00019 #include "orbsvcs/PortableGroupC.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 #pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00026 00027 /** 00028 * @class TAO_PG_Default_Property_Validator 00029 * 00030 * @brief Default property validator implementation. 00031 * 00032 * This Property_Validator verifies that all properties defined in the 00033 * PortableGroup IDL module are valid. This property validator can be 00034 * subclassed to validate a different property set. 00035 */ 00036 class TAO_PortableGroup_Export TAO_PG_Default_Property_Validator 00037 { 00038 public: 00039 00040 /// Constructor. 00041 TAO_PG_Default_Property_Validator (void); 00042 00043 /// Destructor 00044 virtual ~TAO_PG_Default_Property_Validator (void); 00045 00046 /// Validate the given properties. Throw an exception when the 00047 /// first invalid property is encountered. The remaining properties 00048 /// will not be validated. 00049 virtual void validate_property (const PortableGroup::Properties & props 00050 ACE_ENV_ARG_DECL) 00051 ACE_THROW_SPEC ((CORBA::SystemException, 00052 PortableGroup::InvalidProperty, 00053 PortableGroup::UnsupportedProperty)); 00054 00055 /// Validate the given properties/criteria. All criteria 00056 /// will be validated regardless of whether or not an invalid 00057 /// property was encountered. 00058 virtual void validate_criteria (const PortableGroup::Properties & criteria 00059 ACE_ENV_ARG_DECL) 00060 ACE_THROW_SPEC ((CORBA::SystemException, 00061 PortableGroup::InvalidCriteria, 00062 PortableGroup::CannotMeetCriteria)); 00063 00064 private: 00065 00066 /** 00067 * @name Pre-initialize property Names. 00068 * 00069 * These properties are pre-initialized once to reduce property 00070 * validation overhead. Note that the InitialNumberReplicas and 00071 * MinimumNumberReplicas properties are not validated since there are 00072 * no restrictions imposed by TAO's PortableGroup implementation 00073 * regarding the number of such members. 00074 */ 00075 //@{ 00076 PortableGroup::Name membership_; 00077 PortableGroup::Name factories_; 00078 //@} 00079 00080 }; 00081 00082 TAO_END_VERSIONED_NAMESPACE_DECL 00083 00084 #include /**/ "ace/post.h" 00085 00086 #endif /* TAO_PG_PROPERTY_VALIDATOR_H */