00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file RT_Policy_Validator.h 00006 * 00007 * $Id: RT_Policy_Validator.h 77155 2007-02-15 15:23:19Z johnnyw $ 00008 * 00009 * This file contains the declaration for the RTCORBA policy validator. 00010 * 00011 * @author Angelo Corsaro <corsaro@cs.wustl.edu> 00012 * @author Frank Hunleth <fhuntleth@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_RT_POLICY_VALIDATOR_H_ 00017 #define TAO_RT_POLICY_VALIDATOR_H_ 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/orbconf.h" 00022 00023 #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 00024 00025 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00026 # pragma once 00027 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00028 00029 #include "tao/RTPortableServer/rtportableserver_export.h" 00030 #include "tao/Policy_Validator.h" 00031 #include "tao/RTCORBA/RTCORBA.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_ORB_Core; 00036 class TAO_Acceptor_Registry; 00037 class TAO_Thread_Pool; 00038 00039 class TAO_RTPortableServer_Export TAO_POA_RT_Policy_Validator 00040 : public TAO_Policy_Validator 00041 { 00042 public: 00043 /// Constructor. 00044 TAO_POA_RT_Policy_Validator (TAO_ORB_Core &orb_core); 00045 00046 /// Destructor. 00047 ~TAO_POA_RT_Policy_Validator (void); 00048 00049 static RTCORBA::ServerProtocolPolicy_ptr server_protocol_policy_from_thread_pool (TAO_Thread_Pool *thread_pool, 00050 TAO_ORB_Core &orb_core); 00051 00052 static void server_protocol_policy_from_acceptor_registry (RTCORBA::ProtocolList &protocols, 00053 TAO_Acceptor_Registry &acceptor_registry, 00054 TAO_ORB_Core &orb_core); 00055 00056 static TAO_Thread_Pool *extract_thread_pool (TAO_ORB_Core &orb_core, 00057 TAO_Policy_Set &policies); 00058 00059 protected: 00060 00061 /** 00062 * Validate that the policies in the specified set 00063 * are consistent and legal. Throw an appropriate exception 00064 * if that is not the case. 00065 */ 00066 void validate_impl (TAO_Policy_Set &policies); 00067 00068 /// Add/merge policies. 00069 void merge_policies_impl (TAO_Policy_Set &policies); 00070 00071 /** 00072 * Return whether the specified policy type is legal for the 00073 * current configuration. This is needed since the user can 00074 * potentially specify policies that are unknown to an 00075 * validate () routine, and these need to be caught. 00076 */ 00077 virtual CORBA::Boolean legal_policy_impl (CORBA::PolicyType type); 00078 00079 private: 00080 void validate_server_protocol (TAO_Policy_Set &policies); 00081 00082 void validate_priorities (TAO_Policy_Set &policies); 00083 00084 void validate_thread_pool (TAO_Policy_Set &policies); 00085 00086 TAO_Thread_Pool *thread_pool_; 00087 }; 00088 00089 TAO_END_VERSIONED_NAMESPACE_DECL 00090 00091 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */ 00092 00093 #include /**/ "ace/post.h" 00094 00095 #endif /* TAO_RT_POLICY_VALIDATOR_H_ */