Go to the documentation of this file.00001
00002
00003 #include "orbsvcs/Notify/MonitorControlExt/MC_Notify_Service.h"
00004
00005 #include "tao/debug.h"
00006
00007 #include "orbsvcs/Notify/MonitorControl/MonitorManager.h"
00008
00009 #include "orbsvcs/Notify/MonitorControlExt/MC_Default_Factory.h"
00010 #include "orbsvcs/Notify/MonitorControlExt/MonitorEventChannelFactory.h"
00011
00012 #if defined (TAO_HAS_MONITOR_FRAMEWORK) && (TAO_HAS_MONITOR_FRAMEWORK == 1)
00013
00014 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00015
00016 TAO_MC_Notify_Service::~TAO_MC_Notify_Service (void)
00017 {
00018 }
00019
00020 TAO_Notify_Factory*
00021 TAO_MC_Notify_Service::create_factory (void)
00022 {
00023 TAO_MC_Default_Factory* factory = 0;
00024 ACE_NEW_THROW_EX (factory,
00025 TAO_MC_Default_Factory (),
00026 CORBA::NO_MEMORY ());
00027 return factory;
00028 }
00029
00030 void
00031 TAO_MC_Notify_Service::init_i (CORBA::ORB_ptr orb)
00032 {
00033 this->TAO_CosNotify_Service::init_i (orb);
00034
00035 TAO_MonitorManager* monitor =
00036 ACE_Dynamic_Service<TAO_MonitorManager>::instance (
00037 TAO_NOTIFY_MONITOR_CONTROL_MANAGER);
00038 if (monitor == 0)
00039 {
00040 if (TAO_debug_level > 0)
00041 ACE_DEBUG ((LM_DEBUG, "%s must be loaded via "
00042 "the Service Configurator\n",
00043 TAO_NOTIFY_MONITOR_CONTROL_MANAGER));
00044 }
00045 else
00046 {
00047 monitor->run ();
00048 }
00049 }
00050
00051 void
00052 TAO_MC_Notify_Service::init_i2 (CORBA::ORB_ptr orb,
00053 CORBA::ORB_ptr dispatching_orb)
00054 {
00055 this->TAO_CosNotify_Service::init_i2 (orb, dispatching_orb);
00056
00057 TAO_MonitorManager* monitor =
00058 ACE_Dynamic_Service<TAO_MonitorManager>::instance (
00059 TAO_NOTIFY_MONITOR_CONTROL_MANAGER);
00060 if (monitor == 0)
00061 {
00062 if (TAO_debug_level > 0)
00063 ACE_DEBUG ((LM_DEBUG, "%s must be loaded via "
00064 "the Service Configurator\n",
00065 TAO_NOTIFY_MONITOR_CONTROL_MANAGER));
00066 }
00067 else
00068 {
00069 monitor->run ();
00070 }
00071 }
00072
00073 void
00074 TAO_MC_Notify_Service::finalize_service (
00075 CosNotifyChannelAdmin::EventChannelFactory_ptr factory)
00076 {
00077 TAO_MonitorManager::shutdown ();
00078 this->TAO_CosNotify_Service::finalize_service (factory);
00079 }
00080
00081 TAO_END_VERSIONED_NAMESPACE_DECL
00082
00083 ACE_STATIC_SVC_DEFINE (TAO_MC_Notify_Service,
00084 ACE_TEXT (TAO_NOTIFY_MONITOR_CONTROL_EXTENSION),
00085 ACE_Service_Type::SERVICE_OBJECT,
00086 &ACE_SVC_NAME (TAO_MC_Notify_Service),
00087 ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
00088 0)
00089 ACE_FACTORY_DEFINE (TAO_Notify_MC_Ext, TAO_MC_Notify_Service)
00090
00091 #endif
00092