2 #include "tao/CSD_Framework/CSD_POA.h"
3 #include "tao/CSD_Framework/CSD_Strategy_Repository.h"
4 #include "tao/CSD_Framework/CSD_Strategy_Base.h"
6 #include "ace/Dynamic_Service.h"
8 #if !defined (__ACE_INLINE__)
9 # include "tao/CSD_Framework/CSD_POA.inl"
10 #endif /* ! __ACE_INLINE__ */
12 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
14 // Implementation skeleton constructor
15 TAO_CSD_POA::TAO_CSD_POA (const String
&name
,
16 PortableServer::POAManager_ptr poa_manager
,
17 const TAO_POA_Policy_Set
&policies
,
20 TAO_SYNCH_MUTEX
&thread_lock
,
21 TAO_ORB_Core
&orb_core
,
22 TAO_Object_Adapter
*object_adapter
)
23 : TAO_Regular_POA (name
,
32 ACE_NEW_THROW_EX (this->sds_proxy_
,
33 TAO::CSD::Strategy_Proxy (),
38 // Implementation skeleton destructor
39 TAO_CSD_POA::~TAO_CSD_POA ()
41 delete this->sds_proxy_
;
44 void TAO_CSD_POA::set_csd_strategy (::CSD_Framework::Strategy_ptr strategy
)
46 if (CORBA::is_nil (strategy
))
48 throw ::CORBA::BAD_PARAM ();
50 this->sds_proxy_
->custom_strategy (strategy
);
54 TAO_CSD_POA::new_POA (const String
&name
,
55 PortableServer::POAManager_ptr poa_manager
,
56 const TAO_POA_Policy_Set
&policies
,
59 TAO_SYNCH_MUTEX
&thread_lock
,
60 TAO_ORB_Core
&orb_core
,
61 TAO_Object_Adapter
*object_adapter
)
65 ACE_NEW_THROW_EX (poa
,
76 TAO_CSD_Strategy_Repository
*repo
=
77 ACE_Dynamic_Service
<TAO_CSD_Strategy_Repository
>::instance ("TAO_CSD_Strategy_Repository");
81 CSD_Framework::Strategy_var strategy
= repo
->find (name
);
83 if (! ::CORBA::is_nil (strategy
.in ()))
85 poa
->set_csd_strategy (strategy
.in ());
92 void TAO_CSD_POA::poa_activated_hook ()
94 this->sds_proxy_
->poa_activated_event (this->orb_core_
);
97 void TAO_CSD_POA::poa_deactivated_hook ()
99 this->sds_proxy_
->poa_deactivated_event ();
102 void TAO_CSD_POA::servant_activated_hook (PortableServer::Servant servant
,
103 const PortableServer::ObjectId
& oid
)
105 this->sds_proxy_
->servant_activated_event (servant
, oid
);
108 void TAO_CSD_POA::servant_deactivated_hook (PortableServer::Servant servant
,
109 const PortableServer::ObjectId
& oid
)
111 this->sds_proxy_
->servant_deactivated_event (servant
, oid
);
114 TAO_END_VERSIONED_NAMESPACE_DECL