1 #include "tao/CSD_ThreadPool/CSD_ThreadPool.h"
2 #include "tao/CSD_ThreadPool/CSD_TP_Strategy_Factory.h"
3 #include "tao/CSD_Framework/CSD_Framework_Loader.h"
5 #include "ace/Dynamic_Service.h"
7 #include "tao/CSD_Framework/CSD_ORBInitializer.h"
8 #include "tao/PI/DLL_Resident_ORB_Initializer.h"
9 #include "tao/ORBInitializer_Registry.h"
10 #include "tao/ORB_Core.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 TAO_CSD_ThreadPool::init ()
18 static int initialized
= 0;
23 TAO_CSD_Framework_Loader::static_init();
25 // Register the ORB initializer.
28 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer
=
29 PortableInterceptor::ORBInitializer::_nil ();
31 /// Register the CSD ORBInitializer.
32 ACE_NEW_THROW_EX (temp_orb_initializer
,
33 TAO_CSD_ORBInitializer
,
35 CORBA::SystemException::_tao_minor_code (
38 CORBA::COMPLETED_NO
));
40 PortableInterceptor::ORBInitializer_var orb_initializer
;
41 orb_initializer
= temp_orb_initializer
;
43 PortableInterceptor::ORBInitializer_ptr temp_dll_initializer
=
44 PortableInterceptor::ORBInitializer::_nil ();
46 ACE_NEW_THROW_EX (temp_dll_initializer
,
47 PortableInterceptor::DLL_Resident_ORB_Initializer(
48 orb_initializer
.in (),
49 ACE_TEXT ("TAO_CSD_ThreadPool")),
51 CORBA::SystemException::_tao_minor_code (
54 CORBA::COMPLETED_NO
));
56 PortableInterceptor::ORBInitializer_var dll_initializer
;
57 dll_initializer
= temp_dll_initializer
;
59 PortableInterceptor::register_orb_initializer (
60 dll_initializer
.in ());
62 catch (const ::CORBA::Exception
& ex
)
64 ex
._tao_print_exception (
65 "Unexpected exception caught while "
66 "initializing the CSD Framework");
71 return ACE_Service_Config::process_directive (
72 ace_svc_desc_TAO_CSD_TP_Strategy_Factory
);
75 TAO_END_VERSIONED_NAMESPACE_DECL