DbuSignalHandler Class Reference

#include <DbuSignalHandler.h>

List of all members.

Classes

struct  Cleaner

Public Member Functions

void Delay ()
void HandleDelayedSignal ()

Static Public Member Functions

static DbuSignalHandlerInstance ()
static bool SignalAction (int signal)

Private Member Functions

 DbuSignalHandler ()
 DbuSignalHandler (DbuSignalHandler &)
DbuSignalHandleroperator= (const DbuSignalHandler &dsh)
 ~DbuSignalHandler ()

Private Attributes

TSignalHandler * fSIGINT
TSignalHandler * fSIGTERM

Static Private Attributes

static DbuSignalHandlerfgInstance = 0

Friends

struct Cleaner

Detailed Description

Definition at line 13 of file DbuSignalHandler.h.


Constructor & Destructor Documentation

DbuSignalHandler::DbuSignalHandler (  )  [private]

Definition at line 66 of file DbuSignalHandler.cxx.

References fSIGINT, and fSIGTERM.

00066                                    :
00067    fSIGINT(0), fSIGTERM(0)
00068 {
00069   // ctor
00070   // create handlers for SIGTERM and SIGINT
00071 
00072   fSIGINT  = new DbuSIGINTHandler;
00073   fSIGINT->Add();
00074 
00075   fSIGTERM = new DbuSIGTERMHandler;
00076   fSIGTERM->Add();
00077 }

DbuSignalHandler::DbuSignalHandler ( DbuSignalHandler  )  [inline, private]

Definition at line 29 of file DbuSignalHandler.h.

00029 : TObject() { abort(); }

DbuSignalHandler::~DbuSignalHandler (  )  [private]

Definition at line 81 of file DbuSignalHandler.cxx.

References fSIGINT, and fSIGTERM.

00082 {
00083   delete fSIGINT;
00084   delete fSIGTERM;
00085 }


Member Function Documentation

void DbuSignalHandler::Delay (  ) 

Definition at line 103 of file DbuSignalHandler.cxx.

References fSIGINT, fSIGTERM, and logDebug().

Referenced by DbuRunSummary::Commit(), DbuDaqFileSummary::Commit(), DbuDaqMonitorModule::WriteSubRunSummaryEntry(), DbuDaqMonitorModule::WriteVaChipPedsEntry(), and DbuDaqMonitorModule::WriteVaChipSparsEntry().

00104 {
00105    // delay processing of signals until HandleDelayedSignal is called
00106 
00107   fSIGTERM->Delay();
00108   fSIGINT->Delay();
00109 
00110   //syslog(LOG_INFO,"<I> DbuSignalHandler::Delay()");
00111   logDebug(5,"DbuSignalHandler::Delay()");
00112 }

void DbuSignalHandler::HandleDelayedSignal (  ) 

Definition at line 116 of file DbuSignalHandler.cxx.

References fSIGINT, fSIGTERM, and logDebug().

Referenced by DbuRunSummary::Commit(), DbuDaqFileSummary::Commit(), main(), DbuDaqMonitorModule::WriteSubRunSummaryEntry(), DbuDaqMonitorModule::WriteVaChipPedsEntry(), and DbuDaqMonitorModule::WriteVaChipSparsEntry().

00117 {
00118    // processing any delayed signals
00119 
00120   fSIGTERM->HandleDelayedSignal();
00121   fSIGINT->HandleDelayedSignal();
00122 
00123   //syslog(LOG_INFO,"<I> DbuSignalHandler::HandleDelayedSignal()");
00124   logDebug(5,"DbuSignalHandler::HandleDelayedSignal()");
00125 }

DbuSignalHandler & DbuSignalHandler::Instance (  )  [static]
DbuSignalHandler& DbuSignalHandler::operator= ( const DbuSignalHandler dsh  )  [inline, private]

Definition at line 30 of file DbuSignalHandler.h.

00031     { abort(); return const_cast<DbuSignalHandler&>(dsh); }

bool DbuSignalHandler::SignalAction ( int  signal  )  [static]

Definition at line 129 of file DbuSignalHandler.cxx.

References exit(), Msg::kInfo, logNotice(), and MSG.

Referenced by DbuSIGINTHandler::Notify(), and DbuSIGTERMHandler::Notify().

00130 {
00131   // This is where the real work is done
00132   // decisions about what to do when a signal is caught go here
00133 
00134   MSG("Dbu",Msg::kInfo) 
00135     << "Dbu SignalAction (signal " << signal 
00136     << ") called" << endl;
00137 
00138   logNotice("SignalAction: signal %d, attempt shutdown.",signal);
00139 
00140   // make sure the clean up code is called
00141 
00142   // closelog(); // shutdown code might want to write to syslog
00143   //NO!//msgLogCleanup();
00144 
00145   exit(1);
00146 
00147   return true;
00148 
00149 }


Friends And Related Function Documentation

friend struct Cleaner [friend]

Definition at line 45 of file DbuSignalHandler.h.


Member Data Documentation

Definition at line 47 of file DbuSignalHandler.h.

Referenced by Instance(), and DbuSignalHandler::Cleaner::~Cleaner().

TSignalHandler* DbuSignalHandler::fSIGINT [private]

Definition at line 49 of file DbuSignalHandler.h.

Referenced by DbuSignalHandler(), Delay(), HandleDelayedSignal(), and ~DbuSignalHandler().

TSignalHandler* DbuSignalHandler::fSIGTERM [private]

Definition at line 50 of file DbuSignalHandler.h.

Referenced by DbuSignalHandler(), Delay(), HandleDelayedSignal(), and ~DbuSignalHandler().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1