1 #include "tao/RTScheduling/RTScheduler_Loader.h"
2 #include "tao/RTScheduling/RTScheduler_Initializer.h"
5 #include "tao/ORB_Core.h"
6 #include "tao/ORBInitializer_Registry.h"
8 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
10 TAO_RTScheduler_Loader::TAO_RTScheduler_Loader ()
11 : initialized_ (false)
15 TAO_RTScheduler_Loader::~TAO_RTScheduler_Loader ()
20 TAO_RTScheduler_Loader::init (int, ACE_TCHAR
* [])
22 ACE_TRACE ("TAO_RTScheduler_Loader::init");
24 if (TAO_debug_level
> 0)
25 TAOLIB_DEBUG ((LM_DEBUG
,
26 "In RTScheduler_Loader::init\n"));
28 // Only allow initialization once.
29 if (this->initialized_
)
32 this->initialized_
= true;
34 ACE_Service_Gestalt
*gestalt
= ACE_Service_Config::current ();
36 ACE_Service_Object
* const rts_loader
=
37 ACE_Dynamic_Service
<ACE_Service_Object
>::instance (
42 if (rts_loader
!= 0 && rts_loader
!= this)
44 return rts_loader
->init (0, 0);
47 // Register the ORB initializer.
50 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer
=
51 PortableInterceptor::ORBInitializer::_nil ();
53 /// Register the RTCORBA ORBInitializer.
54 ACE_NEW_THROW_EX (temp_orb_initializer
,
55 TAO_RTScheduler_ORB_Initializer
,
57 CORBA::SystemException::_tao_minor_code (
60 CORBA::COMPLETED_NO
));
62 PortableInterceptor::ORBInitializer_var orb_initializer
=
65 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
67 catch (const ::CORBA::Exception
& ex
)
69 ex
._tao_print_exception (
70 "Unexpected exception caught while initializing the RTScheduler:");
77 /////////////////////////////////////////////////////////////////////
79 ACE_FACTORY_DEFINE (TAO_RTScheduler
, TAO_RTScheduler_Loader
)
80 ACE_STATIC_SVC_DEFINE (TAO_RTScheduler_Loader
,
81 ACE_TEXT ("RTScheduler_Loader"),
83 &ACE_SVC_NAME (TAO_RTScheduler_Loader
),
84 ACE_Service_Type::DELETE_THIS
85 | ACE_Service_Type::DELETE_OBJ
,
87 TAO_END_VERSIONED_NAMESPACE_DECL