3 //=============================================================================
5 * @file Active_Policy_Strategies.h
7 * @author Johnny Willemsen <jwillemsen@remedy.nl>
9 //=============================================================================
11 #ifndef TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H
12 #define TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H
14 #include /**/ "ace/pre.h"
16 #include "tao/orbconf.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "tao/PortableServer/ThreadPolicyC.h"
24 #include "tao/PortableServer/IdAssignmentPolicyC.h"
25 #include "tao/PortableServer/IdUniquenessPolicyC.h"
26 #include "tao/PortableServer/ServantRetentionPolicyC.h"
27 #include "tao/PortableServer/LifespanPolicyC.h"
28 #include "tao/PortableServer/ImplicitActivationPolicyC.h"
29 #include "tao/PortableServer/RequestProcessingPolicyC.h"
31 #include "tao/PortableServer/ThreadStrategy.h"
32 #include "tao/PortableServer/IdAssignmentStrategy.h"
33 #include "tao/PortableServer/IdUniquenessStrategy.h"
34 #include "tao/PortableServer/ImplicitActivationStrategy.h"
35 #include "tao/PortableServer/LifespanStrategy.h"
36 #include "tao/PortableServer/RequestProcessingStrategy.h"
37 #include "tao/PortableServer/ServantRetentionStrategy.h"
39 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
45 namespace Portable_Server
47 class Cached_Policies
;
50 * This class stores the active policy strategies used for a certain POA.
52 class Active_Policy_Strategies
55 Active_Policy_Strategies () = default;
57 void update (Cached_Policies
&policies
, TAO_Root_POA
* poa
);
61 ThreadStrategy
*thread_strategy () const;
63 RequestProcessingStrategy
*request_processing_strategy () const;
65 IdAssignmentStrategy
*id_assignment_strategy () const;
67 IdUniquenessStrategy
*id_uniqueness_strategy () const;
69 LifespanStrategy
*lifespan_strategy () const;
71 ImplicitActivationStrategy
*implicit_activation_strategy () const;
73 ServantRetentionStrategy
*servant_retention_strategy () const;
76 void create (::PortableServer::ThreadPolicyValue value
);
77 void create (::PortableServer::IdAssignmentPolicyValue value
);
78 void create (::PortableServer::IdUniquenessPolicyValue value
);
79 void create (::PortableServer::ServantRetentionPolicyValue value
);
80 void create (::PortableServer::LifespanPolicyValue value
);
81 void create (::PortableServer::ImplicitActivationPolicyValue value
);
82 void create (::PortableServer::RequestProcessingPolicyValue value
, ::PortableServer::ServantRetentionPolicyValue srvalue
);
85 std::unique_ptr
<ThreadStrategy
> thread_strategy_
{};
86 std::unique_ptr
<IdAssignmentStrategy
> id_assignment_strategy_
{};
87 std::unique_ptr
<IdUniquenessStrategy
> id_uniqueness_strategy_
{};
88 std::unique_ptr
<ServantRetentionStrategy
> servant_retention_strategy_
{};
89 std::unique_ptr
<LifespanStrategy
> lifespan_strategy_
{};
90 std::unique_ptr
<ImplicitActivationStrategy
> implicit_activation_strategy_
{};
91 std::unique_ptr
<RequestProcessingStrategy
> request_processing_strategy_
{};
95 * This class quards the cleanup of strategies if something went wrong
96 * in the code that called Active_Policy_Strategies::update().
98 class Active_Policy_Strategies_Cleanup_Guard
101 Active_Policy_Strategies_Cleanup_Guard () = delete;
102 Active_Policy_Strategies_Cleanup_Guard (Active_Policy_Strategies
*p
);
103 ~Active_Policy_Strategies_Cleanup_Guard ();
104 Active_Policy_Strategies
*_retn ();
107 Active_Policy_Strategies
*ptr_
;
112 TAO_END_VERSIONED_NAMESPACE_DECL
114 #if defined (__ACE_INLINE__)
115 # include "tao/PortableServer/Active_Policy_Strategies.inl"
116 #endif /* __ACE_INLINE__ */
118 #include /**/ "ace/post.h"
120 #endif /* TAO_PORTABLESERVER_ACTIVE_POLICY_STRATEGIES_H */