nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
nidas::core::DSMServerApp Class Reference

#include <DSMServerApp.h>

Public Member Functions

 DSMServerApp ()
 
 ~DSMServerApp ()
 
void initLogger ()
 
int initProcess ()
 
int run () throw ()
 
int parseRunstring (int argc, char **argv)
 
int usage ()
 Send usage message to cerr. More...
 
void parseXMLConfigFile (const std::string &xmlFileName, Project &) throw (nidas::core::XMLException, nidas::util::InvalidParameterException,nidas::util::IOException)
 Invoke a XMLCachingParser to parse the XML and initialize the Project. More...
 
void startXmlRpcThread () throw (nidas::util::Exception)
 
void killXmlRpcThread () throw ()
 
void startStatusThread (DSMServer *svr) throw (nidas::util::Exception)
 
void killStatusThread () throw ()
 
const std::string & getXMLFileName ()
 What is the XML configuration file name. More...
 
Dataset getDataset ()
 

Static Public Member Functions

static int main (int argc, char **argv) throw ()
 Run DSMServerApp from the unix command line. More...
 
static DSMServerAppgetInstance ()
 

Private Types

enum  runState { RUN, QUIT, RESTART, ERROR }
 

Private Member Functions

void setupSignals ()
 Create a signal mask, and block those masked signals. More...
 
void waitForSignal (int timeoutSecs)
 Unblock and wait for signals of interest up to timeoutSecs. More...
 
 DSMServerApp (const DSMServerApp &)
 Copy not needed. More...
 
DSMServerAppoperator= (const DSMServerApp &)
 Assignment not needed. More...
 

Private Attributes

bool _debug
 -d option. More...
 
std::string _xmlFileName
 The xml file that is being used for configuration information. More...
 
std::string _configsXMLName
 The xml file that contains all the project configurations, by date. More...
 
enum runState _runState
 
DSMServerIntf_xmlrpcThread
 This thread provides XML-based Remote Procedure calls. More...
 
DSMServerStat_statusThread
 
bool _externalControl
 
bool _optionalProcessing
 
sigset_t _signalMask
 
pthread_t _myThreadId
 
std::string _datasetName
 
NidasApp _app
 
NidasAppArg ExternalControl
 
NidasAppArg OptionalProcessing
 

Static Private Attributes

static DSMServerApp_instance = 0
 

Member Enumeration Documentation

Enumerator
RUN 
QUIT 
RESTART 
ERROR 

Constructor & Destructor Documentation

DSMServerApp::DSMServerApp ( )

References setupSignals().

DSMServerApp::~DSMServerApp ( )
nidas::core::DSMServerApp::DSMServerApp ( const DSMServerApp )
private

Copy not needed.

Member Function Documentation

Dataset DSMServerApp::getDataset ( )

References _app, and _datasetName.

Referenced by run().

static DSMServerApp* nidas::core::DSMServerApp::getInstance ( )
inlinestatic

References _instance.

const std::string& nidas::core::DSMServerApp::getXMLFileName ( )
inline

What is the XML configuration file name.

References _xmlFileName.

void DSMServerApp::initLogger ( )

References _app, and nidas::core::NidasApp::setupDaemon().

Referenced by main().

int DSMServerApp::initProcess ( )
void DSMServerApp::killStatusThread ( )
throw (
)
void DSMServerApp::killXmlRpcThread ( )
throw (
)
int DSMServerApp::main ( int  argc,
char **  argv 
)
throw (
)
static
DSMServerApp& nidas::core::DSMServerApp::operator= ( const DSMServerApp )
private

Assignment not needed.

int DSMServerApp::parseRunstring ( int  argc,
char **  argv 
)
void DSMServerApp::parseXMLConfigFile ( const std::string &  xmlFileName,
Project  
)
throw (nidas::core::XMLException,
nidas::util::InvalidParameterException,
nidas::util::IOException
)
int DSMServerApp::run ( )
throw (
)
void DSMServerApp::setupSignals ( )
private

Create a signal mask, and block those masked signals.

DSMEngine uses sigwait, and does not register asynchronous signal handlers.

References _signalMask.

Referenced by DSMServerApp().

void DSMServerApp::startStatusThread ( DSMServer svr)
throw (nidas::util::Exception
)

Referenced by run().

void DSMServerApp::startXmlRpcThread ( )
throw (nidas::util::Exception
)
int DSMServerApp::usage ( )

Send usage message to cerr.

References _app, nidas::core::NidasApp::getProcessName(), and nidas::core::NidasApp::usage().

Referenced by parseRunstring().

void DSMServerApp::waitForSignal ( int  timeoutSecs)
private

Unblock and wait for signals of interest up to timeoutSecs.

After return, _runState will be set depending on the signal received.

References _runState, _signalMask, nidas::util::Exception::errnoToString(), ILOG, PLOG, QUIT, RESTART, timeoutSecs, and WLOG.

Referenced by run().

Member Data Documentation

NidasApp nidas::core::DSMServerApp::_app
private
std::string nidas::core::DSMServerApp::_configsXMLName
private

The xml file that contains all the project configurations, by date.

Referenced by parseRunstring(), and run().

std::string nidas::core::DSMServerApp::_datasetName
private

Referenced by getDataset(), parseRunstring(), and run().

bool nidas::core::DSMServerApp::_debug
private

-d option.

If user wants messages on stderr rather than syslog.

bool nidas::core::DSMServerApp::_externalControl
private
DSMServerApp * DSMServerApp::_instance = 0
staticprivate

Referenced by getInstance().

pthread_t nidas::core::DSMServerApp::_myThreadId
private
bool nidas::core::DSMServerApp::_optionalProcessing
private

Referenced by parseRunstring(), and run().

enum runState nidas::core::DSMServerApp::_runState
private

Referenced by run(), and waitForSignal().

sigset_t nidas::core::DSMServerApp::_signalMask
private

Referenced by setupSignals(), and waitForSignal().

DSMServerStat* nidas::core::DSMServerApp::_statusThread
private

Referenced by killStatusThread().

std::string nidas::core::DSMServerApp::_xmlFileName
private

The xml file that is being used for configuration information.

Referenced by getXMLFileName(), parseRunstring(), and run().

DSMServerIntf* nidas::core::DSMServerApp::_xmlrpcThread
private

This thread provides XML-based Remote Procedure calls.

Referenced by killXmlRpcThread(), run(), and startXmlRpcThread().

NidasAppArg nidas::core::DSMServerApp::ExternalControl
private

Referenced by parseRunstring().

NidasAppArg nidas::core::DSMServerApp::OptionalProcessing
private

Referenced by parseRunstring().


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