POAManager.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    POAManager.h
00006  *
00007  *  POAManager.h,v 1.21 2006/06/20 06:30:34 jwillemsen Exp
00008  *
00009  *   POAManager
00010  *
00011  *  @author  Irfan Pyarali
00012  */
00013 //=============================================================================
00014 
00015 #ifndef TAO_POAMANAGER_H
00016 #define TAO_POAMANAGER_H
00017 #include /**/ "ace/pre.h"
00018 
00019 #include "tao/PortableServer/portableserver_export.h"
00020 
00021 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00022 # pragma once
00023 #endif /* ACE_LACKS_PRAGMA_ONCE */
00024 
00025 #include "tao/PortableServer/poa_macros.h"
00026 #include "tao/PortableServer/POAManagerC.h"
00027 
00028 // Local Object
00029 #include "tao/LocalObject.h"
00030 #include "tao/PI_ForwardC.h"
00031 #include "ace/Unbounded_Set.h"
00032 
00033 // This is to remove "inherits via dominance" warnings from MSVC.
00034 // MSVC is being a little too paranoid.
00035 #if defined(_MSC_VER)
00036 #pragma warning(push)
00037 #pragma warning(disable:4250)
00038 #endif /* _MSC_VER */
00039 
00040 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00041 
00042 // Forward decl.
00043 class TAO_Root_POA;
00044 class TAO_Object_Adapter;
00045 class TAO_POAManager_Factory;
00046 
00047 namespace PortableServer
00048 {
00049   class POAManagerFactory;
00050   typedef POAManagerFactory *POAManagerFactory_ptr;
00051 }
00052 
00053 class TAO_PortableServer_Export TAO_POA_Manager :
00054   public PortableServer::POAManager,
00055   public TAO_Local_RefCounted_Object
00056 {
00057   friend class TAO_Root_POA;
00058   friend class TAO_Object_Adapter;
00059 
00060 public:
00061 
00062   void activate (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00063     ACE_THROW_SPEC ((CORBA::SystemException,
00064                      PortableServer::POAManager::AdapterInactive));
00065 
00066 #if (TAO_HAS_MINIMUM_POA == 0)
00067 
00068   void hold_requests (CORBA::Boolean wait_for_completion
00069                       ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00070     ACE_THROW_SPEC ((CORBA::SystemException,
00071                      PortableServer::POAManager::AdapterInactive));
00072 
00073   void discard_requests (CORBA::Boolean wait_for_completion
00074                          ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00075     ACE_THROW_SPEC ((CORBA::SystemException,
00076                      PortableServer::POAManager::AdapterInactive));
00077 
00078   void deactivate (CORBA::Boolean etherealize_objects,
00079                    CORBA::Boolean wait_for_completion
00080                    ACE_ENV_ARG_DECL_WITH_DEFAULTS)
00081     ACE_THROW_SPEC ((CORBA::SystemException,
00082                      PortableServer::POAManager::AdapterInactive));
00083 
00084 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00085 
00086   PortableServer::POAManager::State get_state (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00087     ACE_THROW_SPEC ((CORBA::SystemException));
00088 
00089   char *get_id (ACE_ENV_SINGLE_ARG_DECL_WITH_DEFAULTS)
00090     ACE_THROW_SPEC ((CORBA::SystemException));
00091 
00092   TAO_POA_Manager (TAO_Object_Adapter &object_adapter,
00093                    const char * id,
00094                    const ::CORBA::PolicyList & policies,
00095                    PortableServer::POAManagerFactory_ptr poa_manager_factory);
00096 
00097   ~TAO_POA_Manager (void);
00098 
00099   /// Check the state of this POA manager
00100   void check_state (ACE_ENV_SINGLE_ARG_DECL);
00101 
00102   PortableServer::POAManager::State get_state_i ()
00103     ACE_THROW_SPEC ((CORBA::SystemException));
00104 
00105   virtual CORBA::ORB_ptr _get_orb (
00106       ACE_ENV_SINGLE_ARG_DECL
00107     );
00108 
00109   CORBA::PolicyList& get_policies ();
00110 
00111 protected:
00112 
00113   void activate_i (ACE_ENV_SINGLE_ARG_DECL)
00114     ACE_THROW_SPEC ((CORBA::SystemException,
00115                      PortableServer::POAManager::AdapterInactive));
00116 
00117   void deactivate_i (CORBA::Boolean etherealize_objects,
00118                      CORBA::Boolean wait_for_completion
00119                      ACE_ENV_ARG_DECL)
00120     ACE_THROW_SPEC ((CORBA::SystemException,
00121                      PortableServer::POAManager::AdapterInactive));
00122 
00123   /// Method needed for notifying the IORInterceptors that the state
00124   /// of POAManager changed.
00125   void adapter_manager_state_changed (PortableServer::POAManager::State state
00126                                       ACE_ENV_ARG_DECL)
00127     ACE_THROW_SPEC ((CORBA::SystemException));
00128 
00129 #if (TAO_HAS_MINIMUM_POA == 0)
00130 
00131   void hold_requests_i (CORBA::Boolean wait_for_completion
00132                         ACE_ENV_ARG_DECL)
00133     ACE_THROW_SPEC ((CORBA::SystemException,
00134                      PortableServer::POAManager::AdapterInactive));
00135 
00136   void discard_requests_i (CORBA::Boolean wait_for_completion
00137                            ACE_ENV_ARG_DECL)
00138     ACE_THROW_SPEC ((CORBA::SystemException,
00139                      PortableServer::POAManager::AdapterInactive));
00140 
00141 #endif /* TAO_HAS_MINIMUM_POA == 0 */
00142 
00143   ACE_Lock &lock (void);
00144 
00145   int remove_poa (TAO_Root_POA *poa);
00146 
00147   int register_poa (TAO_Root_POA *poa);
00148 
00149 protected:
00150 
00151   PortableServer::POAManager::State state_;
00152 
00153   ACE_Lock &lock_;
00154 
00155   typedef ACE_Unbounded_Set<TAO_Root_POA *> POA_COLLECTION;
00156 
00157   POA_COLLECTION poa_collection_;
00158 
00159   TAO_Object_Adapter &object_adapter_;
00160 
00161   CORBA::String_var id_;
00162 
00163 #if !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
00164   TAO_POAManager_Factory& poa_manager_factory_;
00165 #endif
00166 
00167   CORBA::PolicyList policies_;
00168 
00169 private :
00170 
00171   /**
00172    * Generate an id for this POAManager.
00173    * @return A value that uniquely identifies the POAManager within a
00174    *         given process.
00175    * @note: The id_ has the ownership of the memory allocated in this method.
00176    */
00177   char* generate_manager_id (void) const;
00178 };
00179 
00180 TAO_END_VERSIONED_NAMESPACE_DECL
00181 
00182 #if defined(_MSC_VER)
00183 #pragma warning(pop)
00184 #endif /* _MSC_VER */
00185 
00186 #if defined (__ACE_INLINE__)
00187 # include "tao/PortableServer/POAManager.i"
00188 #endif /* __ACE_INLINE__ */
00189 
00190 #include /**/ "ace/post.h"
00191 #endif /* TAO_POAMANAGER_H */

Generated on Thu Nov 9 12:40:40 2006 for TAO_PortableServer by doxygen 1.3.6