Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / PortableServer / Root_POA.h
blob436e6e677047d8a6370105f499220e1a38c88f16
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file Root_POA.h
7 * Header file for CORBA's ORB type.
9 * @author Irfan Pyarali <irfan@cs.wustl.edu>
11 //=============================================================================
13 #ifndef TAO_ROOT_POA_H
14 #define TAO_ROOT_POA_H
16 #include /**/ "ace/pre.h"
18 #include "tao/PortableServer/portableserver_export.h"
20 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 # pragma once
22 #endif /* ACE_LACKS_PRAGMA_ONCE */
24 // Object Adapter
25 #include "tao/PortableServer/Object_Adapter.h"
27 // POA Policy Set
28 #include "tao/PortableServer/POA_Policy_Set.h"
30 // Cached POA Policies
31 #include "tao/PortableServer/POA_Cached_Policies.h"
32 #include "tao/PortableServer/Active_Policy_Strategies.h"
34 #include "tao/PortableServer/ORT_Adapter.h"
36 #include "tao/PortableServer/PortableServer.h"
38 // Object_Key
39 #include "tao/Object_KeyC.h"
41 // Local Object
42 #include "tao/LocalObject.h"
44 // Portable Interceptor
45 #include "tao/PI_ForwardC.h"
47 // OctetSeq
48 #include "tao/OctetSeqC.h"
50 #include "ace/SString.h"
51 #include "ace/Hash_Map_Manager_T.h"
52 #include "ace/Array_Base.h"
53 #include "ace/Synch_Traits.h"
54 #include "ace/Thread_Mutex.h"
55 #include "ace/Recursive_Thread_Mutex.h"
56 #include "ace/Null_Mutex.h"
58 // This is to remove "inherits via dominance" warnings from MSVC.
59 // MSVC is being a little too paranoid.
60 #if defined(_MSC_VER)
61 #pragma warning(push)
62 #pragma warning(disable:4250)
63 #endif /* _MSC_VER */
65 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
67 // Forward Declaration
68 class TAO_Acceptor_Filter;
70 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
71 class TAO_Acceptor_Filter_Factory;
72 class TAO_POAManager_Factory;
73 #endif
75 class TAO_Network_Priority_Hook;
76 class TAO_Acceptor_Registry;
77 class TAO_IORInfo;
78 class TAO_Regular_POA;
79 class TAO_Active_Object_Map;
81 namespace PortableInterceptor
83 class IORInfo;
84 typedef IORInfo *IORInfo_ptr;
87 namespace TAO
89 class ORT_Adapter;
90 class ORT_Adapter_Factory;
92 namespace Portable_Server
94 class Servant_Upcall;
95 class POA_Current_Impl;
96 class Temporary_Creation_Time;
100 namespace PortableServer
102 class POAManager;
103 typedef POAManager *POAManager_ptr;
107 * @class TAO_Root_POA
109 * @brief Implementation of the PortableServer::POA interface.
111 * Implementation of the PortableServer::POA interface.
113 class TAO_PortableServer_Export TAO_Root_POA
114 : public virtual PortableServer::POA,
115 public virtual ::CORBA::LocalObject
117 public:
118 friend class TAO_Object_Adapter;
119 friend class TAO::Portable_Server::Servant_Upcall;
120 friend class TAO::Portable_Server::Non_Servant_Upcall;
121 friend class TAO_POA_Manager;
122 friend class TAO_RT_Collocation_Resolver;
123 friend class TAO_IORInfo;
125 typedef ACE_CString String;
127 /// @note Temporarily for debugging, useful for debugging and status retrieval,
128 /// could be removed with future rework of the AOM.
129 TAO_Active_Object_Map * get_active_object_map() const;
131 #if !defined (CORBA_E_MICRO)
132 PortableServer::POA_ptr create_POA (
133 const char *adapter_name,
134 PortableServer::POAManager_ptr poa_manager,
135 const CORBA::PolicyList &policies);
137 PortableServer::POA_ptr find_POA (const char *adapter_name,
138 CORBA::Boolean activate_it);
139 #endif
141 void destroy (CORBA::Boolean etherealize_objects,
142 CORBA::Boolean wait_for_completion);
144 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
145 PortableServer::ThreadPolicy_ptr create_thread_policy (
146 PortableServer::ThreadPolicyValue value);
147 #endif /* TAO_HAS_MINIMUM_POA == 0 */
149 #if !defined (CORBA_E_MICRO)
150 PortableServer::LifespanPolicy_ptr create_lifespan_policy (
151 PortableServer::LifespanPolicyValue value);
152 #endif
154 #if !defined (CORBA_E_MICRO)
155 PortableServer::IdUniquenessPolicy_ptr create_id_uniqueness_policy (
156 PortableServer::IdUniquenessPolicyValue value);
157 #endif
159 #if !defined (CORBA_E_MICRO)
160 PortableServer::IdAssignmentPolicy_ptr create_id_assignment_policy (
161 PortableServer::IdAssignmentPolicyValue value);
162 #endif
164 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
165 PortableServer::ImplicitActivationPolicy_ptr
166 create_implicit_activation_policy (
167 PortableServer::ImplicitActivationPolicyValue value);
169 PortableServer::ServantRetentionPolicy_ptr
170 create_servant_retention_policy (
171 PortableServer::ServantRetentionPolicyValue value);
173 PortableServer::RequestProcessingPolicy_ptr
174 create_request_processing_policy (
175 PortableServer::RequestProcessingPolicyValue value);
176 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
178 char * the_name ();
180 PortableServer::POA_ptr the_parent ();
182 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
183 PortableServer::POAList *the_children ();
184 #endif /* TAO_HAS_MINIMUM_POA == 0 && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
186 PortableServer::POAManager_ptr the_POAManager ();
188 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
189 PortableServer::POAManagerFactory_ptr the_POAManagerFactory ();
190 #endif
192 /// This method returns the adapter_name as a sequence of strings of
193 /// length one or more or just a fixed name depending on the Object
194 /// Adapter. Added wrt to ORT Spec.
195 PortableInterceptor::AdapterName *adapter_name ();
197 /// Store the given TaggedComponent for eventual insertion into all
198 /// object reference profiles.
199 void save_ior_component (const IOP::TaggedComponent &component);
201 /// Store the given TaggedComponent for eventual insertion into all
202 /// object reference profiles with the given ProfileId.
203 void save_ior_component_and_profile_id (
204 const IOP::TaggedComponent &component,
205 IOP::ProfileId profile_id);
207 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
208 PortableServer::AdapterActivator_ptr the_activator ();
210 void the_activator (PortableServer::AdapterActivator_ptr adapter_activator);
212 PortableServer::ServantManager_ptr get_servant_manager ();
214 void set_servant_manager (PortableServer::ServantManager_ptr imgr);
216 PortableServer::Servant get_servant ();
218 void set_servant (PortableServer::Servant servant);
219 #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
221 PortableServer::ObjectId *activate_object (PortableServer::Servant p_servant);
223 void activate_object_with_id (const PortableServer::ObjectId &id,
224 PortableServer::Servant p_servant);
226 void deactivate_object (const PortableServer::ObjectId &oid);
228 CORBA::Object_ptr create_reference (const char *intf);
230 #if !defined (CORBA_E_MICRO)
231 CORBA::Object_ptr create_reference_with_id (
232 const PortableServer::ObjectId &oid,
233 const char *intf);
234 #endif
236 PortableServer::ObjectId *servant_to_id (PortableServer::Servant p_servant);
238 PortableServer::ObjectId *servant_to_user_id (PortableServer::Servant p_servant);
240 CORBA::Object_ptr servant_to_reference (PortableServer::Servant p_servant);
242 PortableServer::Servant reference_to_servant (CORBA::Object_ptr reference);
244 PortableServer::ObjectId *reference_to_id (CORBA::Object_ptr reference);
246 PortableServer::Servant id_to_servant (const PortableServer::ObjectId &oid);
248 CORBA::Object_ptr id_to_reference (const PortableServer::ObjectId &oid);
250 CORBA::OctetSeq *id ();
252 /// Accessor for POA policies.
253 TAO_POA_Policy_Set &policies ();
255 /// Get the set policy of the given type.
256 CORBA::Policy_ptr get_policy (CORBA::PolicyType policy);
258 /// This method gives the policies that are exposed to the client.
259 /// These policies are shipped within the IOR.
260 virtual CORBA::PolicyList *client_exposed_policies (
261 CORBA::Short object_priority);
263 TAO_Root_POA (const String &name,
264 PortableServer::POAManager_ptr poa_manager,
265 const TAO_POA_Policy_Set &policies,
266 TAO_Root_POA *parent,
267 ACE_Lock &lock,
268 TAO_SYNCH_MUTEX &thread_lock,
269 TAO_ORB_Core &orb_core,
270 TAO_Object_Adapter *object_adapter);
272 virtual ~TAO_Root_POA ();
274 static char name_separator ();
276 static CORBA::ULong name_separator_length ();
278 static constexpr size_t TAO_OBJECTKEY_PREFIX_SIZE = 4;
280 static CORBA::Octet const objectkey_prefix[TAO_OBJECTKEY_PREFIX_SIZE];
282 const TAO_Object_Adapter::poa_name &folded_name () const;
284 const TAO_Object_Adapter::poa_name &system_name () const;
286 static void check_for_valid_wait_for_completions (
287 const TAO_ORB_Core &orb_core,
288 CORBA::Boolean wait_for_completion);
290 /// ORB Core for POA.
291 TAO_ORB_Core &orb_core () const;
293 /// obtain a reference to the cached_profiles
294 TAO::Portable_Server::Cached_Policies& cached_policies ();
296 /// obtain a handle to the network priority hooks
297 TAO_Network_Priority_Hook* network_priority_hook ();
299 TAO::Portable_Server::Cached_Policies::PriorityModel priority_model () const;
301 CORBA::Boolean cleanup_in_progress ();
303 /// Calls protected static method used when POACurrent is not appropriate.
304 static int parse_ir_object_key (const TAO::ObjectKey &object_key,
305 PortableServer::ObjectId &user_id);
307 TAO_Object_Adapter &object_adapter ();
309 ACE_Lock &lock ();
311 /// Create the correct stub, properly initialized with the
312 /// attributes and policies attached to the current POA.
313 TAO_Stub* key_to_stub (const TAO::ObjectKey &key,
314 const char *type_id,
315 CORBA::Short priority);
317 /// Accessor methods to POA state.
319 * The POA can be in one of HOLDING, ACTIVE, DISCARDING, INACTIVE
320 * and NON_EXISTENT states.
322 PortableInterceptor::AdapterState get_adapter_state ();
324 virtual void *thread_pool () const;
326 virtual CORBA::Policy *server_protocol ();
328 CORBA::ULong outstanding_requests () const;
330 const ACE_CString &name () const;
332 CORBA::Boolean waiting_destruction () const;
334 static void ort_adapter_factory_name (const char *name);
336 static const char *ort_adapter_factory_name ();
338 /// Sets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.
339 static void imr_client_adapter_name (const char *name);
341 /// Gets the value of TAO_POA_Static_Resources::imr_client_adapter_name_.
342 static const char *imr_client_adapter_name ();
344 CORBA::Object_ptr invoke_key_to_object ();
346 CORBA::Boolean system_id ();
348 CORBA::ULong waiting_servant_deactivation () const;
350 /// Return the POA Manager related to this POA
351 TAO_POA_Manager &tao_poa_manager ();
353 bool is_poa_generated (CORBA::Object_ptr reference,
354 PortableServer::ObjectId &system_id);
357 * Validate if the servant may be activated
358 * @retval true This servant may be activated
359 * @retval false This servant may not be activated
361 bool is_servant_activation_allowed (
362 PortableServer::Servant servant,
363 bool &wait_occurred_restart_call);
365 int rebind_using_user_id_and_system_id (
366 PortableServer::Servant servant,
367 const PortableServer::ObjectId &user_id,
368 const PortableServer::ObjectId &system_id,
369 TAO::Portable_Server::Servant_Upcall &servant_upcall);
371 CORBA::Boolean servant_has_remaining_activations (
372 PortableServer::Servant servant);
374 bool allow_implicit_activation () const;
376 bool allow_multiple_activations () const;
378 int is_servant_active (
379 PortableServer::Servant servant,
380 bool &wait_occurred_restart_call);
382 void deactivate_object_i (const PortableServer::ObjectId &oid);
384 CORBA::Boolean is_persistent () const;
386 CORBA::Short server_priority () const;
388 bool has_system_id () const;
390 PortableServer::Servant find_servant (const PortableServer::ObjectId &system_id);
392 TAO_Servant_Location servant_present (
393 const PortableServer::ObjectId &system_id,
394 PortableServer::Servant &servant);
396 PortableServer::Servant find_servant (
397 const PortableServer::ObjectId &system_id,
398 TAO::Portable_Server::Servant_Upcall &servant_upcall,
399 TAO::Portable_Server::POA_Current_Impl &poa_current_impl);
402 * Find the the servant with ObjectId @a system_id, and retrieve
403 * its priority. Usually used in RT CORBA with SERVER_DECLARED
404 * priority model.
406 * @return -1 if servant does not exist, else 0 indicating the
407 * servant exists and priority successfully retrieved.
409 int find_servant_priority (
410 const PortableServer::ObjectId &system_id,
411 CORBA::Short &priority);
413 int unbind_using_user_id (const PortableServer::ObjectId &user_id);
415 void cleanup_servant (
416 PortableServer::Servant servant,
417 const PortableServer::ObjectId &user_id);
419 void post_invoke_servant_cleanup(
420 const PortableServer::ObjectId &system_id,
421 const TAO::Portable_Server::Servant_Upcall &servant_upcall);
423 bool validate_lifespan (
424 CORBA::Boolean is_persistent,
425 const TAO::Portable_Server::Temporary_Creation_Time& creation_time) const;
427 PortableServer::ObjectId *activate_object_i (
428 PortableServer::Servant p_servant,
429 CORBA::Short priority,
430 bool &wait_occurred_restart_call);
432 CORBA::Object_ptr id_to_reference_i (const PortableServer::ObjectId &oid,
433 bool indirect);
435 PortableServer::ObjectId *servant_to_id_i (PortableServer::Servant servant);
437 TAO_SYNCH_CONDITION &servant_deactivation_condition ();
439 int is_poa_generated_id (const PortableServer::ObjectId &id);
441 /// Check the state of this POA
442 void check_state ();
444 int delete_child (const String &child);
446 PortableServer::Servant user_id_to_servant_i (const PortableServer::ObjectId &oid);
448 virtual CORBA::ORB_ptr _get_orb ();
450 /// These hooks are needed by the CSD strategy to override
451 /// and no-ops by default.
453 /// Hook - The POA has been (or is being) activated.
454 virtual void poa_activated_hook ();
456 /// Hook - The POA has been deactivated.
457 virtual void poa_deactivated_hook ();
459 /// Hook - A servant has been activated.
460 virtual void servant_activated_hook (PortableServer::Servant servant,
461 const PortableServer::ObjectId& oid);
463 /// Hook - A servant has been deactivated.
464 virtual void servant_deactivated_hook (PortableServer::Servant servant,
465 const PortableServer::ObjectId& oid);
467 protected:
468 #if (TAO_HAS_MINIMUM_POA == 0)
469 int enter ();
471 int exit ();
472 #endif /* TAO_HAS_MINIMUM_POA == 0 */
474 #if ! defined (CORBA_E_MICRO)
475 /// Template method for creating new POA's of this type.
476 virtual TAO_Root_POA *new_POA (const String &name,
477 PortableServer::POAManager_ptr poa_manager,
478 const TAO_POA_Policy_Set &policies,
479 TAO_Root_POA *parent,
480 ACE_Lock &lock,
481 TAO_SYNCH_MUTEX &thread_lock,
482 TAO_ORB_Core &orb_core,
483 TAO_Object_Adapter *object_adapter);
485 PortableServer::POA_ptr create_POA_i (
486 const char *adapter_name,
487 PortableServer::POAManager_ptr poa_manager,
488 const CORBA::PolicyList &policies);
490 PortableServer::POA_ptr create_POA_i (const String &adapter_name,
491 PortableServer::POAManager_ptr poa_manager,
492 const TAO_POA_Policy_Set &policies);
494 TAO_Root_POA *find_POA_i (const ACE_CString &child_name,
495 CORBA::Boolean activate_it);
496 #endif
498 void destroy_i (CORBA::Boolean etherealize_objects,
499 CORBA::Boolean wait_for_completion);
501 void complete_destruction_i ();
503 PortableServer::POAList *the_children_i ();
505 /// This method returns the adapter_name as a sequence of strings of
506 /// length one or more or just a fixed name depending on the Object
507 /// Adapter. Added wrt to ORT Spec.
508 PortableInterceptor::AdapterName *adapter_name_i ();
510 /// Method to notify the IOR Interceptors when there is a state
511 /// changed not related to POAManager.
512 void adapter_state_changed (
513 const TAO::ORT_Array &array_obj_ref_template,
514 PortableInterceptor::AdapterState state);
516 /// Add the given tagged component to all profiles.
517 void add_ior_component (TAO_MProfile & mprofile,
518 const IOP::TaggedComponent & component);
520 /// Add the given tagged component to all profiles matching the given
521 /// ProfileId.
522 void add_ior_component_to_profile (TAO_MProfile & mprofile,
523 const IOP::TaggedComponent & component,
524 IOP::ProfileId profile_id);
526 /// Wrapper for the ORB's key_to_object that will alter the object pointer
527 /// if the ImplRepo is used.
528 CORBA::Object_ptr key_to_object (const TAO::ObjectKey &key,
529 const char *type_id,
530 TAO_ServantBase *servant,
531 CORBA::Boolean collocated,
532 CORBA::Short priority,
533 bool indirect);
535 /// Like key_to_stub() but assume that the ORB is not shutting down.
536 virtual TAO_Stub* key_to_stub_i (const TAO::ObjectKey &key,
537 const char *type_id,
538 CORBA::Short priority);
540 TAO_Stub *create_stub_object (const TAO::ObjectKey &object_key,
541 const char *type_id,
542 CORBA::PolicyList *policy_list,
543 TAO_Acceptor_Filter *filter,
544 TAO_Acceptor_Registry &acceptor_registry);
546 PortableServer::Servant get_servant_i ();
548 protected:
549 void activate_object_with_id_i (const PortableServer::ObjectId &id,
550 PortableServer::Servant p_servant,
551 CORBA::Short priority,
552 bool &wait_occurred_restart_call);
554 virtual void remove_from_parent_i ();
556 void deactivate_all_objects_i (CORBA::Boolean etherealize_objects);
558 void deactivate_all_objects_i (CORBA::Boolean etherealize_objects,
559 CORBA::Boolean wait_for_completion);
561 void wait_for_completions (CORBA::Boolean wait_for_completion);
563 CORBA::Object_ptr create_reference_i (const char *intf,
564 CORBA::Short priority);
566 CORBA::Object_ptr create_reference_with_id_i (
567 const PortableServer::ObjectId &oid,
568 const char *intf,
569 CORBA::Short priority);
571 PortableServer::Servant reference_to_servant_i (CORBA::Object_ptr reference);
573 CORBA::Object_ptr servant_to_reference_i (PortableServer::Servant p_servant);
575 PortableServer::Servant id_to_servant_i (const PortableServer::ObjectId &oid);
577 /// Call the IORInterceptor::establish_components() method on all
578 /// registered IORInterceptors.
580 * This method calls IORInterceptor::establish_components() method
581 * on all registered IORInterceptors, and
582 * IORInterceptor::components_established() once the former is
583 * completed.
585 void establish_components ();
587 /// Call the IORInterceptor::components_established() method on all
588 /// registered IORInterceptors.
589 void components_established (PortableInterceptor::IORInfo_ptr info);
591 void set_folded_name (TAO_Root_POA *parent);
593 void set_id (TAO_Root_POA *parent);
595 TAO::ObjectKey *create_object_key (const PortableServer::ObjectId &id);
597 static int parse_key (const TAO::ObjectKey &key,
598 TAO_Object_Adapter::poa_name &poa_system_name,
599 PortableServer::ObjectId &system_id,
600 CORBA::Boolean &is_root,
601 CORBA::Boolean &is_persistent,
602 CORBA::Boolean &is_system_id,
603 TAO::Portable_Server::Temporary_Creation_Time &poa_creation_time);
605 protected:
606 /// Accessor methods to ObjectReferenceTemplate
607 PortableInterceptor::ObjectReferenceTemplate *
608 get_adapter_template ();
610 /// Accessor methods to ObjectReferenceTemplate, non locked version
611 PortableInterceptor::ObjectReferenceTemplate *get_adapter_template_i ();
613 /// Accessor methods to PortableInterceptor::ObjectReferenceFactory
614 PortableInterceptor::ObjectReferenceFactory *get_obj_ref_factory ();
616 /// Set the object reference factory
617 void set_obj_ref_factory (
618 PortableInterceptor::ObjectReferenceFactory *current_factory);
621 TAO_Servant_Location locate_servant_i (const PortableServer::ObjectId &id,
622 PortableServer::Servant &servant);
624 PortableServer::Servant locate_servant_i (
625 const char *operation,
626 const PortableServer::ObjectId &id,
627 TAO::Portable_Server::Servant_Upcall &servant_upcall,
628 TAO::Portable_Server::POA_Current_Impl &poa_current_impl,
629 bool &wait_occurred_restart_call);
631 public:
632 /// @todo Temporarily for servant retention
633 CORBA::Object_ptr
634 invoke_key_to_object_helper_i (const char * repository_id,
635 const PortableServer::ObjectId & id);
636 protected:
637 /// Get the ORT adapter, in case there is no adapter yet, this method will
638 /// try to create one and hold the POA lock
639 TAO::ORT_Adapter *ORT_adapter ();
641 /// Get the ORT adapter, in case there is no adapter yet, this method will
642 /// try to create one but assumes the POA lock is already hold
643 TAO::ORT_Adapter *ORT_adapter_i ();
645 CORBA::Boolean persistent ();
647 static char persistent_key_char ();
649 static char transient_key_char ();
651 static CORBA::ULong persistent_key_type_length ();
653 static char system_id_key_char ();
655 static char user_id_key_char ();
657 static CORBA::ULong system_id_key_type_length ();
659 virtual CORBA::Boolean root () const;
661 virtual char root_key_type ();
663 static char root_key_char ();
665 static char non_root_key_char ();
667 static CORBA::ULong root_key_type_length ();
669 CORBA::ULong increment_outstanding_requests ();
671 CORBA::ULong decrement_outstanding_requests ();
673 String name_;
675 /// Reference to the POAManager that this poa assicuates with.
676 TAO_POA_Manager &poa_manager_;
678 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
679 /// Reference to the POAManagerFactory that generate the POAManager.
680 TAO_POAManager_Factory& poa_manager_factory_;
681 #endif
683 IOP::TaggedComponentSeq tagged_component_;
685 IOP::TaggedComponentSeq tagged_component_id_;
687 ACE_Array_Base <IOP::ProfileId> profile_id_array_;
689 TAO_POA_Policy_Set policies_;
691 TAO_Object_Adapter::poa_name folded_name_;
693 TAO_Object_Adapter::poa_name_var system_name_;
695 CORBA::OctetSeq id_;
697 /// Pointer to the object reference template adapter.
698 TAO::ORT_Adapter *ort_adapter_;
700 /// Pointer to the object reference template adapter factory.
701 TAO::ORT_Adapter_Factory *ort_adapter_factory_;
703 /// Adapter can be accepting, rejecting etc.
704 PortableInterceptor::AdapterState adapter_state_;
706 TAO::Portable_Server::Cached_Policies cached_policies_;
708 TAO_Network_Priority_Hook *network_priority_hook_;
710 TAO::Portable_Server::Active_Policy_Strategies active_policy_strategies_;
712 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
713 PortableServer::AdapterActivator_var adapter_activator_;
714 #endif /* TAO_HAS_MINIMUM_POA == 0 !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO) */
716 typedef
717 ACE_Hash_Map_Manager_Ex<
718 ACE_CString, TAO_Root_POA *,
719 ACE_Hash<ACE_CString>,
720 ACE_Equal_To<ACE_CString>,
721 ACE_Null_Mutex
723 CHILDREN;
725 CHILDREN children_;
727 ACE_Lock &lock_;
729 TAO_ORB_Core &orb_core_;
731 /// The object adapter we belong to
732 TAO_Object_Adapter *object_adapter_;
734 CORBA::Boolean cleanup_in_progress_;
736 CORBA::ULong outstanding_requests_;
738 TAO_SYNCH_CONDITION outstanding_requests_condition_;
740 CORBA::Boolean wait_for_completion_pending_;
742 CORBA::Boolean waiting_destruction_;
744 TAO_SYNCH_CONDITION servant_deactivation_condition_;
746 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
747 TAO_Acceptor_Filter_Factory * filter_factory_;
748 #endif
750 public:
751 // @todo Temporarily for servant retention
752 CORBA::ULong caller_key_to_object_;
754 PortableServer::Servant servant_for_key_to_object_;
756 struct Key_To_Object_Params
758 PortableServer::ObjectId_var *system_id_;
759 const char *type_id_;
760 TAO_ServantBase *servant_;
761 CORBA::Boolean collocated_;
762 CORBA::Short priority_;
763 bool indirect_;
765 void set (PortableServer::ObjectId_var &system_id,
766 const char *type_id,
767 TAO_ServantBase *servant,
768 CORBA::Boolean collocated,
769 CORBA::Short priority,
770 bool indirect);
773 Key_To_Object_Params key_to_object_params_;
777 * @class TAO_POA_Static_Resources
779 * @brief The static (global) resoures of all POA's.
781 * This class is used by the POA to store the resources global to
782 * all POA's. All instance variables that would have been
783 * declared "static" in TAO_Regular_POA, should be declared in this class
784 * to avoid the "static initialization order fiasco" as described in
785 * http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.11.
786 * Briefly, this is the problem that occurs if any static initializers
787 * in any other code call into set static members of TAO_Regular_POA.
788 * Since the order in which these initializers execute is unspecified,
789 * uninitialized members can be accessed.
791 class TAO_PortableServer_Export TAO_POA_Static_Resources
793 public:
794 /// Return the singleton instance.
795 static TAO_POA_Static_Resources* instance ();
797 /// Cleanup the static singleton
798 static void fini () ACE_GCC_DESTRUCTOR_ATTRIBUTE;
800 public:
802 * Name of the factory object used to adapt function calls on the
803 * PortableInterceptor interfaces ORT. The default value is
804 * "ObjectReferenceTemplate_Adapter_Factory". If the ORT library is linked,
805 * the corresponding accessor function
806 * objectreferencefactory_adapter_factory_name() will be called to set
807 * the value to "Concrete_ObjectReferenceTemplate_Adapter_Factory".
809 ACE_CString ort_adapter_factory_name_;
812 * Name of the service object for functions that make calls on
813 * the Implementation Repository. The default value is "ImR_Client_Adapter".
814 * If TAO_IMR_CLient is linked, imr_client_adapter_name() will be
815 * called to set the value to "Concrete_ImR_Client_Adapter".
817 ACE_CString imr_client_adapter_name_;
818 private:
819 /// Constructor.
820 TAO_POA_Static_Resources ();
822 private:
823 /// The singleton instance.
824 static TAO_POA_Static_Resources* instance_;
826 /// Mostly unused variable whose sole purpose is to enforce
827 /// the instantiation of a TAO_POA_Static_Resources instance
828 /// at initialization time.
829 static TAO_POA_Static_Resources* initialization_reference_;
832 TAO_END_VERSIONED_NAMESPACE_DECL
834 // ****************************************************************
836 #if defined(_MSC_VER)
837 #pragma warning(pop)
838 #endif /* _MSC_VER */
840 #if defined (__ACE_INLINE__)
841 # include "tao/PortableServer/Root_POA.inl"
842 #endif /* __ACE_INLINE__ */
844 #include /**/ "ace/post.h"
846 #endif /* TAO_ROOT_POA_H */