Go to the documentation of this file.00001
00002
00003 #include "tao/CSD_Framework/CSD_Default_Servant_Dispatcher.h"
00004 #include "tao/CSD_Framework/CSD_POA.h"
00005 #include "tao/CSD_Framework/CSD_Strategy_Repository.h"
00006 #include "ace/Dynamic_Service.h"
00007
00008 ACE_RCSID(CSD_Framework,
00009 CSD_Default_Servant_Dispatcher,
00010 "$Id: CSD_Default_Servant_Dispatcher.cpp 76551 2007-01-24 13:42:44Z johnnyw $")
00011
00012
00013 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00014
00015 TAO_CSD_Default_Servant_Dispatcher::~TAO_CSD_Default_Servant_Dispatcher (void)
00016 {
00017 }
00018
00019
00020 TAO_Root_POA *
00021 TAO_CSD_Default_Servant_Dispatcher::create_Root_POA (const ACE_CString &name,
00022 PortableServer::POAManager_ptr poa_manager,
00023 const TAO_POA_Policy_Set &policies,
00024 ACE_Lock &lock,
00025 TAO_SYNCH_MUTEX &thread_lock,
00026 TAO_ORB_Core &orb_core,
00027 TAO_Object_Adapter *object_adapter
00028 )
00029 {
00030 TAO_CSD_POA *poa = 0;
00031
00032 ACE_NEW_THROW_EX (poa,
00033 TAO_CSD_POA (name,
00034 poa_manager,
00035 policies,
00036 0,
00037 lock,
00038 thread_lock,
00039 orb_core,
00040 object_adapter
00041 ),
00042 CORBA::NO_MEMORY ());
00043
00044
00045 TAO_CSD_Strategy_Repository *repo =
00046 ACE_Dynamic_Service<TAO_CSD_Strategy_Repository>::instance ("TAO_CSD_Strategy_Repository");
00047
00048 if (repo == 0)
00049 {
00050 if (TAO_debug_level > 0)
00051 ACE_DEBUG ((LM_DEBUG,
00052 ACE_TEXT("(%P|%t) CSD_Default_Servant_Dispatcher::")
00053 ACE_TEXT("create_POA could not find ")
00054 ACE_TEXT("TAO_CSD_Strategy_Repository\n")));
00055 return 0;
00056 }
00057
00058 CSD_Framework::Strategy_var strategy = repo->find (name);
00059
00060 if (! ::CORBA::is_nil (strategy.in ()))
00061 {
00062 poa->set_csd_strategy (strategy.in ());
00063 }
00064
00065 return poa;
00066 }
00067
00068 TAO_END_VERSIONED_NAMESPACE_DECL