Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / CSD_Framework / CSD_Default_Servant_Dispatcher.cpp
blobd1239cf0555c45feb0a0ad9d25f2b6222f676809
1 // -*- C++ -*-
2 #include "tao/CSD_Framework/CSD_Default_Servant_Dispatcher.h"
3 #include "tao/CSD_Framework/CSD_POA.h"
4 #include "tao/CSD_Framework/CSD_Strategy_Repository.h"
5 #include "ace/Dynamic_Service.h"
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_CSD_Default_Servant_Dispatcher::~TAO_CSD_Default_Servant_Dispatcher ()
14 TAO_Root_POA *
15 TAO_CSD_Default_Servant_Dispatcher::create_Root_POA (const ACE_CString &name,
16 PortableServer::POAManager_ptr poa_manager,
17 const TAO_POA_Policy_Set &policies,
18 ACE_Lock &lock,
19 TAO_SYNCH_MUTEX &thread_lock,
20 TAO_ORB_Core &orb_core,
21 TAO_Object_Adapter *object_adapter)
23 TAO_CSD_POA *poa = 0;
25 ACE_NEW_THROW_EX (poa,
26 TAO_CSD_POA (name,
27 poa_manager,
28 policies,
30 lock,
31 thread_lock,
32 orb_core,
33 object_adapter),
34 CORBA::NO_MEMORY ());
37 TAO_CSD_Strategy_Repository *repo =
38 ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance ("TAO_CSD_Strategy_Repository");
40 if (repo == 0)
42 if (TAO_debug_level > 0)
43 TAOLIB_DEBUG ((LM_DEBUG,
44 ACE_TEXT("(%P|%t) CSD_Default_Servant_Dispatcher::")
45 ACE_TEXT("create_POA could not find ")
46 ACE_TEXT("TAO_CSD_Strategy_Repository\n")));
47 return 0;
50 CSD_Framework::Strategy_var strategy = repo->find (name);
52 if (! ::CORBA::is_nil (strategy.in ()))
54 poa->set_csd_strategy (strategy.in ());
57 return poa;
60 TAO_END_VERSIONED_NAMESPACE_DECL