3 //=============================================================================
9 * @author Irfan Pyarali
11 //=============================================================================
13 #ifndef TAO_POAMANAGER_H
14 #define TAO_POAMANAGER_H
15 #include /**/ "ace/pre.h"
17 #include "tao/PortableServer/portableserver_export.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/PortableServer/poa_macros.h"
24 #include "tao/PortableServer/POAManagerC.h"
27 #include "tao/LocalObject.h"
28 #include "tao/PI_ForwardC.h"
29 #include "ace/Unbounded_Set.h"
31 // This is to remove "inherits via dominance" warnings from MSVC.
32 // MSVC is being a little too paranoid.
35 #pragma warning(disable:4250)
38 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
42 class TAO_Object_Adapter
;
44 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
45 class TAO_POAManager_Factory
;
47 namespace PortableServer
49 class POAManagerFactory
;
50 typedef POAManagerFactory
*POAManagerFactory_ptr
;
54 class TAO_PortableServer_Export TAO_POA_Manager
:
55 public PortableServer::POAManager
,
56 public ::CORBA::LocalObject
58 friend class TAO_Root_POA
;
59 friend class TAO_Object_Adapter
;
64 #if (TAO_HAS_MINIMUM_POA == 0)
66 void hold_requests (CORBA::Boolean wait_for_completion
);
68 void discard_requests (CORBA::Boolean wait_for_completion
);
70 void deactivate (CORBA::Boolean etherealize_objects
,
71 CORBA::Boolean wait_for_completion
);
73 #endif /* TAO_HAS_MINIMUM_POA == 0 */
75 PortableServer::POAManager::State
get_state ();
79 TAO_POA_Manager (TAO_Object_Adapter
&object_adapter
,
80 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
82 const ::CORBA::PolicyList
& policies
,
83 PortableServer::POAManagerFactory_ptr poa_manager_factory
);
90 /// Check the state of this POA manager
93 PortableServer::POAManager::State
get_state_i ();
95 virtual CORBA::ORB_ptr
_get_orb ();
97 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
98 CORBA::PolicyList
& get_policies ();
104 void deactivate_i (CORBA::Boolean etherealize_objects
,
105 CORBA::Boolean wait_for_completion
);
107 /// Method needed for notifying the IORInterceptors that the state
108 /// of POAManager changed.
109 void adapter_manager_state_changed (PortableServer::POAManager::State state
);
111 #if (TAO_HAS_MINIMUM_POA == 0)
113 void hold_requests_i (CORBA::Boolean wait_for_completion
);
115 void discard_requests_i (CORBA::Boolean wait_for_completion
);
117 #endif /* TAO_HAS_MINIMUM_POA == 0 */
121 int remove_poa (TAO_Root_POA
*poa
);
123 int register_poa (TAO_Root_POA
*poa
);
126 PortableServer::POAManager::State state_
;
130 typedef ACE_Unbounded_Set
<TAO_Root_POA
*> POA_COLLECTION
;
132 POA_COLLECTION poa_collection_
;
134 TAO_Object_Adapter
&object_adapter_
;
136 CORBA::String_var id_
;
138 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
139 TAO_POAManager_Factory
& poa_manager_factory_
;
140 CORBA::PolicyList policies_
;
145 * Generate an id for this POAManager.
146 * @return A value that uniquely identifies the POAManager within a
148 * @note: The id_ has the ownership of the memory allocated in this method.
150 char* generate_manager_id () const;
153 TAO_END_VERSIONED_NAMESPACE_DECL
155 #if defined(_MSC_VER)
157 #endif /* _MSC_VER */
159 #if defined (__ACE_INLINE__)
160 # include "tao/PortableServer/POAManager.inl"
161 #endif /* __ACE_INLINE__ */
163 #include /**/ "ace/post.h"
164 #endif /* TAO_POAMANAGER_H */