1 #include "tao/PortableServer/POA_Cached_Policies.h"
2 #include "tao/PortableServer/POA_Policy_Set.h"
3 #include "tao/PortableServer/IdAssignmentPolicyC.h"
4 #include "tao/PortableServer/IdUniquenessPolicyC.h"
5 #include "tao/PortableServer/ImplicitActivationPolicyC.h"
6 #include "tao/PortableServer/LifespanPolicyC.h"
7 #include "tao/PortableServer/RequestProcessingPolicyC.h"
8 #include "tao/PortableServer/ServantRetentionPolicyC.h"
9 #include "tao/PortableServer/ThreadPolicyC.h"
11 #if !defined (__ACE_INLINE__)
12 # include "tao/PortableServer/POA_Cached_Policies.inl"
13 #endif /* ! __ACE_INLINE__ */
15 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
19 namespace Portable_Server
21 Cached_Policies::Cached_Policies () :
22 thread_ (::PortableServer::ORB_CTRL_MODEL
),
23 lifespan_ (::PortableServer::TRANSIENT
),
24 id_uniqueness_ (::PortableServer::UNIQUE_ID
),
25 id_assignment_ (::PortableServer::SYSTEM_ID
),
26 implicit_activation_ (::PortableServer::NO_IMPLICIT_ACTIVATION
),
27 servant_retention_ (::PortableServer::RETAIN
),
28 request_processing_ (::PortableServer::USE_ACTIVE_OBJECT_MAP_ONLY
),
29 priority_model_ (Cached_Policies::NOT_SPECIFIED
),
30 server_priority_ (TAO_INVALID_PRIORITY
),
31 network_priority_model_ (Cached_Policies::NO_NETWORK_PRIORITY
),
32 request_diffserv_codepoint_ (0),
33 reply_diffserv_codepoint_ (0)
38 Cached_Policies::~Cached_Policies ()
43 Cached_Policies::update (TAO_POA_Policy_Set
&policy_set
)
45 for (CORBA::ULong i
= 0; i
< policy_set
.num_policies (); i
++)
47 CORBA::Policy_var policy
= policy_set
.get_policy_by_index (i
);
49 this->update_policy (policy
.in ());
54 Cached_Policies::update_policy (const CORBA::Policy_ptr policy
)
57 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
58 ::PortableServer::ThreadPolicy_var thread
59 = ::PortableServer::ThreadPolicy::_narrow (policy
);
61 if (!CORBA::is_nil (thread
.in ()))
63 this->thread_
= thread
->value ();
67 #endif /* TAO_HAS_MINIMUM_POA == 0 */
69 #if !defined (CORBA_E_MICRO)
70 ::PortableServer::LifespanPolicy_var lifespan
71 = ::PortableServer::LifespanPolicy::_narrow (policy
);
73 if (!CORBA::is_nil (lifespan
.in ()))
75 this->lifespan_
= lifespan
->value ();
81 #if !defined (CORBA_E_MICRO)
82 ::PortableServer::IdUniquenessPolicy_var id_uniqueness
83 = ::PortableServer::IdUniquenessPolicy::_narrow (policy
);
85 if (!CORBA::is_nil (id_uniqueness
.in ()))
87 this->id_uniqueness_
= id_uniqueness
->value ();
93 #if !defined (CORBA_E_MICRO)
94 ::PortableServer::IdAssignmentPolicy_var id_assignment
95 = ::PortableServer::IdAssignmentPolicy::_narrow (policy
);
97 if (!CORBA::is_nil (id_assignment
.in ()))
99 this->id_assignment_
= id_assignment
->value ();
105 #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
107 ::PortableServer::ImplicitActivationPolicy_var implicit_activation
108 = ::PortableServer::ImplicitActivationPolicy::_narrow (policy
);
110 if (!CORBA::is_nil (implicit_activation
.in ()))
112 this->implicit_activation_
= implicit_activation
->value ();
117 ::PortableServer::ServantRetentionPolicy_var servant_retention
118 = ::PortableServer::ServantRetentionPolicy::_narrow (policy
);
120 if (!CORBA::is_nil (servant_retention
.in ()))
122 this->servant_retention_
= servant_retention
->value ();
127 ::PortableServer::RequestProcessingPolicy_var request_processing
128 = ::PortableServer::RequestProcessingPolicy::_narrow (policy
);
130 if (!CORBA::is_nil (request_processing
.in ()))
132 this->request_processing_
= request_processing
->value ();
137 #endif /* TAO_HAS_MINIMUM_POA == 0 */
139 #if defined (CORBA_E_MICRO)
140 ACE_UNUSED_ARG (policy
);
146 TAO_END_VERSIONED_NAMESPACE_DECL