Go to the documentation of this file.00001 #include "tao/Monitor/Monitor.h"
00002 #include "tao/Monitor/Monitor_Impl.h"
00003
00004 ACE_RCSID (Monitor,
00005 Monitor,
00006 "$Id: Monitor.cpp 84281 2009-01-30 15:01:17Z wotte $")
00007
00008 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00009
00010 #if defined (TAO_HAS_MONITOR_FRAMEWORK) && (TAO_HAS_MONITOR_FRAMEWORK == 1)
00011
00012 TAO_Monitor_Init::TAO_Monitor_Init (void)
00013 {
00014 }
00015
00016 CORBA::Object_ptr
00017 TAO_Monitor_Init::create_object (CORBA::ORB_ptr orb,
00018 int,
00019 ACE_TCHAR *[])
00020 {
00021 try
00022 {
00023 CORBA::Object_var obj =
00024 orb->resolve_initial_references ("RootPOA");
00025
00026 PortableServer::POA_var poa =
00027 PortableServer::POA::_narrow (obj.in ());
00028
00029 PortableServer::POAManager_var mgr =
00030 poa->the_POAManager ();
00031
00032 mgr->activate ();
00033
00034 Monitor_Impl *servant = 0;
00035 ACE_NEW_RETURN (servant,
00036 Monitor_Impl (orb),
00037 CORBA::Object::_nil ());
00038
00039 PortableServer::ObjectId_var id =
00040 poa->activate_object (servant);
00041
00042 PortableServer::ServantBase_var safe_servant = servant;
00043 obj = servant->_this ();
00044
00045 return obj._retn ();
00046 }
00047 catch (const CORBA::Exception&)
00048 {
00049 }
00050
00051 return CORBA::Object::_nil ();
00052 }
00053
00054
00055
00056
00057 int
00058 TAO_Monitor_Init::Initializer (void)
00059 {
00060 return ACE_Service_Config::process_directive (ace_svc_desc_TAO_Monitor_Init);
00061 }
00062
00063
00064 ACE_STATIC_SVC_DEFINE (TAO_Monitor_Init,
00065 ACE_TEXT ("Monitor_Init"),
00066 ACE_SVC_OBJ_T,
00067 &ACE_SVC_NAME (TAO_Monitor_Init),
00068 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00069 0)
00070 ACE_FACTORY_DEFINE (TAO_Monitor, TAO_Monitor_Init)
00071
00072 TAO_END_VERSIONED_NAMESPACE_DECL
00073
00074 #endif
00075