2 #include "tao/Monitor/Monitor.h"
3 #include "tao/Monitor/Monitor_Impl.h"
5 #if defined (TAO_HAS_MONITOR_FRAMEWORK) && (TAO_HAS_MONITOR_FRAMEWORK == 1)
7 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
9 TAO_Monitor_Init::TAO_Monitor_Init ()
14 TAO_Monitor_Init::create_object (CORBA::ORB_ptr orb
,
20 CORBA::Object_var obj
=
21 orb
->resolve_initial_references ("RootPOA");
23 PortableServer::POA_var poa
=
24 PortableServer::POA::_narrow (obj
.in ());
26 PortableServer::POAManager_var mgr
=
27 poa
->the_POAManager ();
31 Monitor_Impl
*servant
= 0;
32 ACE_NEW_RETURN (servant
,
34 CORBA::Object::_nil ());
36 PortableServer::ObjectId_var id
=
37 poa
->activate_object (servant
);
39 PortableServer::ServantBase_var safe_servant
= servant
;
40 obj
= servant
->_this ();
44 catch (const CORBA::Exception
&)
48 return CORBA::Object::_nil ();
51 // This initializer is very similar to the ORBInitializer_Registry::init.
52 // This one is used during static initialization while the other is used
53 // when Monitor is a shared library.
55 TAO_Monitor_Init::Initializer ()
57 return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Monitor_Init
);
61 ACE_STATIC_SVC_DEFINE (TAO_Monitor_Init
,
62 ACE_TEXT ("Monitor_Init"),
64 &ACE_SVC_NAME (TAO_Monitor_Init
),
65 ACE_Service_Type::DELETE_THIS
| ACE_Service_Type::DELETE_OBJ
,
67 ACE_FACTORY_DEFINE (TAO_Monitor
, TAO_Monitor_Init
)
69 TAO_END_VERSIONED_NAMESPACE_DECL
71 #endif /* TAO_HAS_MONITOR_FRAMEWORK==1 */