CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlarmHandler.h
Go to the documentation of this file.
1 // $Id: AlarmHandler.h,v 1.10 2011/11/08 10:48:39 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_AlarmHandler_h
5 #define EventFilter_StorageManager_AlarmHandler_h
6 
7 #include <string>
8 
9 #include "boost/shared_ptr.hpp"
10 #include "boost/thread/mutex.hpp"
11 
12 #include "xcept/Exception.h"
13 #include "xdaq/Application.h"
14 #include "xdata/InfoSpace.h"
15 
16 
17 namespace stor {
18 
19  class SharedResources;
20 
21 
31  {
32 
33  public:
34 
36 
37  // Constructor for MockAlarmHandler (unit tests)
39 
40  // Constructor for SMProxy
41  explicit AlarmHandler(xdaq::Application*);
42 
43  // Constructor for SM
45  (
46  xdaq::Application*,
47  boost::shared_ptr<SharedResources>
48  );
49 
50  virtual ~AlarmHandler() {};
51 
55  virtual void notifySentinel
56  (
57  const ALARM_LEVEL,
59  );
60 
64  virtual void raiseAlarm
65  (
66  const std::string name,
67  const ALARM_LEVEL,
69  );
70 
74  virtual void revokeAlarm(const std::string name);
75 
79  void clearAllAlarms();
80 
84  virtual void moveToFailedState( xcept::Exception& );
85 
90  void localDebug( const std::string& message ) const;
91 
95  Logger& getLogger() const
96  { return app_->getApplicationLogger(); }
97 
98 
99  private:
100 
101  bool raiseAlarm
102  (
103  const std::string name,
104  const std::string level,
106  );
107 
108  xdaq::Application* app_;
109  boost::shared_ptr<SharedResources> sharedResources_;
110  xdata::InfoSpace* alarmInfoSpace_;
111 
113 
114  };
115 
116  typedef boost::shared_ptr<AlarmHandler> AlarmHandlerPtr;
117 
118 } // namespace stor
119 
120 #endif // EventFilter_StorageManager_AlarmHandler_h
121 
122 
virtual void notifySentinel(const ALARM_LEVEL, xcept::Exception &)
Definition: AlarmHandler.cc:98
static boost::mutex mutex
Definition: LHEProxy.cc:11
xdaq::Application * app_
Definition: AlarmHandler.h:108
xdata::InfoSpace * alarmInfoSpace_
Definition: AlarmHandler.h:110
virtual void raiseAlarm(const std::string name, const ALARM_LEVEL, xcept::Exception &)
Definition: AlarmHandler.cc:59
virtual void revokeAlarm(const std::string name)
void localDebug(const std::string &message) const
boost::shared_ptr< SharedResources > sharedResources_
Definition: AlarmHandler.h:109
boost::shared_ptr< AlarmHandler > AlarmHandlerPtr
Definition: AlarmHandler.h:116
virtual void moveToFailedState(xcept::Exception &)
Logger & getLogger() const
Definition: AlarmHandler.h:95
virtual ~AlarmHandler()
Definition: AlarmHandler.h:50
boost::mutex mutex_
Definition: AlarmHandler.h:112
tuple level
Definition: testEve_cfg.py:34