2 #include "tao/PI_Server/PI_Server_Loader.h"
3 #include "tao/PI_Server/PortableServer_ORBInitializer.h"
6 #include "tao/ORB_Core.h"
7 #include "tao/ORBInitializer_Registry.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_PI_Server_Loader::TAO_PI_Server_Loader ()
12 : initialized_ (false)
16 TAO_PI_Server_Loader::~TAO_PI_Server_Loader ()
21 TAO_PI_Server_Loader::init (int, ACE_TCHAR
* [])
23 ACE_TRACE ("TAO_PI_Server_Loader::init");
25 // Only allow initialization once.
26 if (this->initialized_
)
29 this->initialized_
= true;
31 // Register the ORB initializer.
34 /// Register the Messaging ORBInitializer.
35 PortableInterceptor::ORBInitializer_ptr temp_orb_initializer
=
36 PortableInterceptor::ORBInitializer::_nil ();
38 ACE_NEW_THROW_EX (temp_orb_initializer
,
39 TAO_PortableServer_ORBInitializer
,
41 CORBA::SystemException::_tao_minor_code (
44 CORBA::COMPLETED_NO
));
46 PortableInterceptor::ORBInitializer_var orb_initializer
=
49 PortableInterceptor::register_orb_initializer (orb_initializer
.in ());
51 catch (const ::CORBA::Exception
& ex
)
53 ex
._tao_print_exception ("Caught exception:");
61 /////////////////////////////////////////////////////////////////////
63 ACE_FACTORY_DEFINE (TAO_PI_Server
, TAO_PI_Server_Loader
)
64 ACE_STATIC_SVC_DEFINE (TAO_PI_Server_Loader
,
65 ACE_TEXT ("PI_Server_Loader"),
67 &ACE_SVC_NAME (TAO_PI_Server_Loader
),
68 ACE_Service_Type::DELETE_THIS
69 | ACE_Service_Type::DELETE_OBJ
,
71 TAO_END_VERSIONED_NAMESPACE_DECL