Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / tao / CSD_ThreadPool / CSD_ThreadPool.cpp
blob27f2459cf3d3ee23abbb40e87afa98fcde5dd23b
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"
4 #include "tao/debug.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
15 int
16 TAO_CSD_ThreadPool::init ()
18 static int initialized = 0;
19 if (initialized == 1)
20 return 0;
21 initialized = 1;
23 TAO_CSD_Framework_Loader::static_init();
25 // Register the ORB initializer.
26 try
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,
34 CORBA::NO_MEMORY (
35 CORBA::SystemException::_tao_minor_code (
36 TAO::VMCID,
37 ENOMEM),
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")),
50 CORBA::NO_MEMORY (
51 CORBA::SystemException::_tao_minor_code (
52 TAO::VMCID,
53 ENOMEM),
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");
67 return 1;
71 return ACE_Service_Config::process_directive (
72 ace_svc_desc_TAO_CSD_TP_Strategy_Factory);
75 TAO_END_VERSIONED_NAMESPACE_DECL