RT_Policy_Validator.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    RT_Policy_Validator.h
00006  *
00007  *  RT_Policy_Validator.h,v 1.11 2006/03/10 07:19:16 jtc Exp
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                                                ACE_ENV_ARG_DECL);
00059 
00060 protected:
00061 
00062   /**
00063    * Validate that the policies in the specified set
00064    * are consistent and legal.  Throw an appropriate exception
00065    * if that is not the case.
00066    */
00067   void validate_impl (TAO_Policy_Set &policies
00068                       ACE_ENV_ARG_DECL);
00069 
00070   /// Add/merge policies.
00071   void merge_policies_impl (TAO_Policy_Set &policies
00072                             ACE_ENV_ARG_DECL);
00073 
00074   /**
00075    * Return whether the specified policy type is legal for the
00076    * current configuration.  This is needed since the user can
00077    * potentially specify policies that are unknown to an
00078    * validate () routine, and these need to be caught.
00079    */
00080   virtual CORBA::Boolean legal_policy_impl (CORBA::PolicyType type);
00081 
00082 private:
00083   void validate_server_protocol (TAO_Policy_Set &policies
00084                                  ACE_ENV_ARG_DECL);
00085 
00086   void validate_priorities (TAO_Policy_Set &policies
00087                             ACE_ENV_ARG_DECL);
00088 
00089   void validate_thread_pool (TAO_Policy_Set &policies
00090                              ACE_ENV_ARG_DECL);
00091 
00092   TAO_Thread_Pool *thread_pool_;
00093 
00094 };
00095 
00096 TAO_END_VERSIONED_NAMESPACE_DECL
00097 
00098 #endif /* TAO_HAS_CORBA_MESSAGING && TAO_HAS_CORBA_MESSAGING != 0 */
00099 
00100 #include /**/ "ace/post.h"
00101 
00102 #endif /* TAO_RT_POLICY_VALIDATOR_H_ */

Generated on Thu Nov 9 12:55:46 2006 for TAO_RTPortableServer by doxygen 1.3.6