1 #include "tao/Messaging/Messaging_Loader.h"
2 #include "tao/Messaging/Messaging_ORBInitializer.h"
3 #include "tao/Messaging/AMI_Arguments_Converter_Impl.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/ORBInitializer_Registry.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_Messaging_Loader::TAO_Messaging_Loader ()
12 : initialized_ (false)
16 TAO_Messaging_Loader::~TAO_Messaging_Loader ()
21 TAO_Messaging_Loader::init (int, ACE_TCHAR
* [])
23 ACE_TRACE ("TAO_Messaging_Loader::init");
25 if (this->initialized_
)
28 this->initialized_
= true;
30 ACE_Service_Gestalt
*gestalt
= ACE_Service_Config::current ();
32 ACE_Service_Object
* const messaging_loader
=
33 ACE_Dynamic_Service
<ACE_Service_Object
>::instance (
38 if (messaging_loader
!= 0 && messaging_loader
!= this)
40 return messaging_loader
->init (0, 0);
43 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer
=
44 PortableInterceptor::ORBInitializer::_nil ();
45 PortableInterceptor::ORBInitializer_var orb_initializer
;
49 /// Register the Messaging ORBInitializer.
51 ACE_NEW_THROW_EX (temp_orb_initializer
,
52 TAO_Messaging_ORBInitializer
,
54 CORBA::SystemException::_tao_minor_code (
57 CORBA::COMPLETED_NO
));
59 orb_initializer
= temp_orb_initializer
;
61 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
63 catch (const ::CORBA::Exception
& ex
)
65 if (TAO_debug_level
> 0)
67 ex
._tao_print_exception ("Caught exception:");
76 /////////////////////////////////////////////////////////////////////
78 ACE_FACTORY_DEFINE (TAO_Messaging
, TAO_Messaging_Loader
)
79 ACE_STATIC_SVC_DEFINE (TAO_Messaging_Loader
,
80 ACE_TEXT ("Messaging_Loader"),
82 &ACE_SVC_NAME (TAO_Messaging_Loader
),
83 ACE_Service_Type::DELETE_THIS
84 | ACE_Service_Type::DELETE_OBJ
,
87 TAO_END_VERSIONED_NAMESPACE_DECL