Go to the documentation of this file.00001
00002
00003 #include "tao/CSD_Framework/CSD_Framework_Loader.h"
00004 #include "tao/CSD_Framework/CSD_Object_Adapter_Factory.h"
00005 #include "tao/CSD_Framework/CSD_Strategy_Repository.h"
00006 #include "tao/CSD_Framework/CSD_ORBInitializer.h"
00007 #include "tao/PI/DLL_Resident_ORB_Initializer.h"
00008 #include "tao/ORBInitializer_Registry.h"
00009
00010 ACE_RCSID (CSD_Framework,
00011 CSD_Framework_Loader,
00012 "$Id: CSD_Framework_Loader.cpp 87582 2009-11-16 16:04:12Z vzykov $")
00013
00014 #include "tao/ORB_Core.h"
00015
00016 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00017
00018 TAO_CSD_Framework_Loader::TAO_CSD_Framework_Loader (void)
00019 : initialized_ (false)
00020 {
00021 }
00022
00023 TAO_CSD_Framework_Loader::~TAO_CSD_Framework_Loader (void)
00024 {
00025 }
00026
00027
00028 int
00029 TAO_CSD_Framework_Loader::static_init (void)
00030 {
00031 ACE_Service_Config::process_directive
00032 (ace_svc_desc_TAO_CSD_Object_Adapter_Factory);
00033
00034 ACE_Service_Config::process_directive
00035 (ace_svc_desc_TAO_CSD_Strategy_Repository);
00036
00037 ACE_Service_Config::process_directive (ace_svc_desc_TAO_CSD_Framework_Loader);
00038
00039 return 0;
00040 }
00041
00042 int
00043 TAO_CSD_Framework_Loader::init (int, ACE_TCHAR* [])
00044 {
00045 ACE_TRACE ("TAO_CSD_Framework_Loader::init");
00046
00047
00048 if (this->initialized_)
00049 return 0;
00050
00051 this->initialized_ = true;
00052
00053
00054 try
00055 {
00056 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer =
00057 PortableInterceptor::ORBInitializer::_nil ();
00058
00059
00060 ACE_NEW_THROW_EX (temp_orb_initializer,
00061 TAO_CSD_ORBInitializer,
00062 CORBA::NO_MEMORY (
00063 CORBA::SystemException::_tao_minor_code (
00064 TAO::VMCID,
00065 ENOMEM),
00066 CORBA::COMPLETED_NO));
00067
00068 PortableInterceptor::ORBInitializer_var orb_initializer;
00069 orb_initializer = temp_orb_initializer;
00070
00071 PortableInterceptor::ORBInitializer_ptr temp_dll_initializer =
00072 PortableInterceptor::ORBInitializer::_nil ();
00073
00074 ACE_NEW_THROW_EX (temp_dll_initializer,
00075 PortableInterceptor::DLL_Resident_ORB_Initializer(
00076 orb_initializer.in (),
00077 ACE_TEXT ("TAO_CSD_ThreadPool")),
00078 CORBA::NO_MEMORY (
00079 CORBA::SystemException::_tao_minor_code (
00080 TAO::VMCID,
00081 ENOMEM),
00082 CORBA::COMPLETED_NO));
00083
00084 PortableInterceptor::ORBInitializer_var dll_initializer;
00085 dll_initializer = temp_dll_initializer;
00086
00087 PortableInterceptor::register_orb_initializer (dll_initializer.in ());
00088 }
00089 catch (const ::CORBA::Exception& ex)
00090 {
00091 ex._tao_print_exception (
00092 "Unexpected exception caught while "
00093 "initializing the CSD Framework");
00094 return 1;
00095 }
00096
00097 return 0;
00098 }
00099
00100
00101
00102
00103 ACE_FACTORY_DEFINE (TAO_CSD_FW, TAO_CSD_Framework_Loader)
00104 ACE_STATIC_SVC_DEFINE (TAO_CSD_Framework_Loader,
00105 ACE_TEXT ("CSD_Framework_Loader"),
00106 ACE_SVC_OBJ_T,
00107 &ACE_SVC_NAME (TAO_CSD_Framework_Loader),
00108 ACE_Service_Type::DELETE_THIS
00109 | ACE_Service_Type::DELETE_OBJ,
00110 0)
00111 TAO_END_VERSIONED_NAMESPACE_DECL