ACE::Monitor_Control::Monitor_Admin Class Reference

#include <Monitor_Admin.h>

Collaboration diagram for ACE::Monitor_Control::Monitor_Admin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Monitor_Admin (void)
 ~Monitor_Admin (void)
bool monitor_point (Monitor_Base *monitor_point, const ACE_Time_Value &time)
Monitor_Basemonitor_point (const char *name)
void auto_query (ACE_Event_Handler *handler, MonitorQuery *query, const ACE_Time_Value &time)
void reactor (ACE_Reactor *new_reactor)
ACE_Reactorreactor (void) const

Private Attributes

Monitor_Point_Auto_Updater auto_updater_
ACE_Reactorreactor_
bool default_reactor_

Detailed Description

Definition at line 67 of file Monitor_Admin.h.


Constructor & Destructor Documentation

ACE::Monitor_Control::Monitor_Admin::Monitor_Admin ( void   ) 

Definition at line 30 of file Monitor_Admin.cpp.

00031       : reactor_ (ACE_Reactor::instance ()),
00032         default_reactor_ (true)
00033     {}

ACE::Monitor_Control::Monitor_Admin::~Monitor_Admin ( void   ) 

Definition at line 35 of file Monitor_Admin.cpp.

References ACE::Monitor_Control::Monitor_Point_Registry::cleanup(), ACE_Reactor::close_singleton(), ACE::Monitor_Control::Monitor_Point_Registry::instance(), and ACE_Reactor::instance().

00036     {
00037       if (this->default_reactor_)
00038         {
00039           /// Destroys the timers associated with our event handler
00040           /// before its destructor is called.
00041           ACE_Reactor::instance ()->close_singleton ();
00042         }
00043 
00044       /// We access the registry through ACE_Singleton, which
00045       /// doesn't call the destructor, so we call this method to
00046       /// do a remove_ref() on all monitor points left in the registry.
00047       /// which needs to be done before the registry goes away.
00048       Monitor_Point_Registry::instance ()->cleanup ();
00049     }


Member Function Documentation

void ACE::Monitor_Control::Monitor_Admin::auto_query ( ACE_Event_Handler handler,
MonitorQuery *  query,
const ACE_Time_Value time 
)

Works similarly to monitor_point() above, but registers the handler arg's handle_timeout() method with the reactor, instead of our auto_updater_'s handle_timeout().

Definition at line 85 of file Monitor_Admin.cpp.

References reactor_, ACE_Reactor::schedule_timer(), ACE_OS::time(), and ACE_Time_Value::zero.

00088     {
00089       this->reactor_->schedule_timer (handler,
00090                                       query,
00091                                       ACE_Time_Value::zero,
00092                                       time);
00093     }

Monitor_Base * ACE::Monitor_Control::Monitor_Admin::monitor_point ( const char *  name  ) 

Definition at line 78 of file Monitor_Admin.cpp.

References ACE::Monitor_Control::Monitor_Point_Registry::get(), and ACE::Monitor_Control::Monitor_Point_Registry::instance().

00079     {
00080       ACE_CString name_str (name, 0, false);
00081       return Monitor_Point_Registry::instance ()->get (name_str);
00082     }

bool ACE::Monitor_Control::Monitor_Admin::monitor_point ( Monitor_Base monitor_point,
const ACE_Time_Value time 
)

Add or access monitor points in a global registry If the ACE_Time_Value arg is non-zero, the monitor point, the auto updater member, and the given time interval are passed to our reactor's register_timeout() method.

This call checks for a null monitor_point.

Definition at line 52 of file Monitor_Admin.cpp.

References ACE_ERROR_RETURN, ACE::Monitor_Control::Monitor_Point_Registry::add(), ACE::Monitor_Control::Monitor_Point_Registry::instance(), LM_ERROR, reactor_, ACE_Reactor::schedule_timer(), ACE_OS::time(), and ACE_Time_Value::zero.

Referenced by ACE::Monitor_Control::Monitor_Base::add_to_registry().

00054     {
00055       /// This call checks for a null monitor_point.
00056       bool good_reg_add =
00057         Monitor_Point_Registry::instance ()->add (monitor_point);
00058 
00059       if (!good_reg_add)
00060         {
00061           ACE_ERROR_RETURN ((LM_ERROR,
00062                              "registration of %s failed\n",
00063                              monitor_point->name ()),
00064                              good_reg_add);
00065         }
00066       else if (time != ACE_Time_Value::zero)
00067         {
00068           this->reactor_->schedule_timer (&this->auto_updater_,
00069                                           monitor_point,
00070                                           ACE_Time_Value::zero,
00071                                           time);
00072         }
00073 
00074       return good_reg_add;
00075     }

ACE_Reactor * ACE::Monitor_Control::Monitor_Admin::reactor ( void   )  const

Definition at line 103 of file Monitor_Admin.cpp.

References reactor_.

00104     {
00105       return this->reactor_;
00106     }

void ACE::Monitor_Control::Monitor_Admin::reactor ( ACE_Reactor new_reactor  ) 

This mutator allows the application to create its own reactor and substitute it for the default reactor.

Definition at line 96 of file Monitor_Admin.cpp.

References default_reactor_, and reactor_.

00097     {
00098       this->reactor_ = new_reactor;
00099       this->default_reactor_ = false;
00100     }


Member Data Documentation

Monitor_Point_Auto_Updater ACE::Monitor_Control::Monitor_Admin::auto_updater_ [private]

Definition at line 96 of file Monitor_Admin.h.

bool ACE::Monitor_Control::Monitor_Admin::default_reactor_ [private]

Definition at line 98 of file Monitor_Admin.h.

Referenced by reactor().

ACE_Reactor* ACE::Monitor_Control::Monitor_Admin::reactor_ [private]

Definition at line 97 of file Monitor_Admin.h.

Referenced by auto_query(), monitor_point(), and reactor().


The documentation for this class was generated from the following files:
Generated on Tue Feb 2 17:36:04 2010 for ACE by  doxygen 1.4.7