nidas v1.2.3
|
#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. | |
void | parseXMLConfigFile (const std::string &xmlFileName, Project &) |
Invoke a XMLCachingParser to parse the XML and initialize the Project. | |
void | startXmlRpcThread () |
void | killXmlRpcThread () |
void | startStatusThread (DSMServer *svr) |
void | killStatusThread () |
const std::string & | getXMLFileName () |
What is the XML configuration file name. | |
Dataset | getDataset () |
Static Public Member Functions | |
static int | main (int argc, char **argv) throw () |
Run DSMServerApp from the unix command line. | |
static DSMServerApp * | getInstance () |
Private Types | |
enum | runState { RUN , QUIT , RESTART , ERROR } |
Private Member Functions | |
void | setupSignals () |
Create a signal mask, and block those masked signals. | |
void | waitForSignal (int timeoutSecs) |
Unblock and wait for signals of interest up to timeoutSecs. | |
DSMServerApp (const DSMServerApp &) | |
Copy not needed. | |
DSMServerApp & | operator= (const DSMServerApp &) |
Assignment not needed. | |
Private Attributes | |
bool | _debug |
-d option. | |
std::string | _xmlFileName |
The xml file that is being used for configuration information. | |
std::string | _configsXMLName |
The xml file that contains all the project configurations, by date. | |
enum runState | _runState |
DSMServerIntf * | _xmlrpcThread |
This thread provides XML-based Remote Procedure calls. | |
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 |
DSMServerApp::DSMServerApp | ( | ) |
References setupSignals().
DSMServerApp::~DSMServerApp | ( | ) |
|
private |
Copy not needed.
Dataset DSMServerApp::getDataset | ( | ) |
References _app, _datasetName, and nidas::core::NidasApp::getDataset().
Referenced by run().
|
inlinestatic |
References _instance.
|
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 | ( | ) |
References _app, nidas::core::NidasApp::checkPidFile(), and nidas::core::NidasApp::setupProcess().
Referenced by main().
void DSMServerApp::killStatusThread | ( | ) |
)
References _statusThread, DLOG, nidas::util::Thread::isRunning(), nidas::util::Thread::join(), nidas::util::Thread::kill(), and WLOG.
Referenced by run().
void DSMServerApp::killXmlRpcThread | ( | ) |
)
References _xmlrpcThread, DLOG, nidas::core::XmlRpcThread::interrupt(), nidas::util::Thread::join(), and WLOG.
Referenced by main().
Run DSMServerApp from the unix command line.
References nidas::core::XMLCachingParser::destroyInstance(), DLOG, nidas::core::getSample(), initLogger(), initProcess(), killXmlRpcThread(), parseRunstring(), PLOG, run(), startXmlRpcThread(), and nidas::core::XMLImplementation::terminate().
Referenced by main().
|
private |
Assignment not needed.
References _app, _configsXMLName, _datasetName, _externalControl, _optionalProcessing, _xmlFileName, nidas::core::NidasAppArg::asBool(), nidas::core::NidasApp::ConfigsArg, nidas::core::NidasApp::DatasetName, nidas::core::NidasApp::DebugDaemon, nidas::core::NidasApp::enableArguments(), ExternalControl, nidas::core::NidasApp::getConfigsXML(), nidas::core::getSample(), nidas::core::NidasAppArg::getValue(), nidas::core::NidasApp::Help, nidas::core::NidasApp::helpRequested(), nidas::core::NidasApp::Hostname, nidas::core::NidasApp::loggingArgs(), OptionalProcessing, nidas::core::NidasApp::parseArgs(), nidas::core::NidasApp::unparsedArgs(), usage(), nidas::core::NidasApp::Username, and nidas::core::NidasApp::Version.
Referenced by main().
Invoke a XMLCachingParser to parse the XML and initialize the Project.
nidas::core::XMLException | |
nidas::util::InvalidParameterException | |
nidas::util::IOException |
References nidas::core::XMLCachingParser::getInstance(), and NLOG.
Referenced by run().
int DSMServerApp::run | ( | ) | ||||
throw | ( | ) |
References _app, _configsXMLName, _datasetName, _optionalProcessing, _runState, _xmlFileName, _xmlrpcThread, ERROR, nidas::core::ProjectConfigs::getConfig(), getDataset(), nidas::core::NidasApp::getHostName(), nidas::core::SampleOutputRequestThread::getInstance(), nidas::core::getSample(), nidas::core::ProjectConfig::getXMLName(), nidas::core::ProjectConfig::initProject(), killStatusThread(), nidas::core::ProjectConfigs::parseXML(), parseXMLConfigFile(), PLOG, QUIT, RUN, nidas::core::DSMServerIntf::setDSMServer(), startStatusThread(), and waitForSignal().
Referenced by main().
|
private |
Create a signal mask, and block those masked signals.
DSMEngine uses sigwait, and does not register asynchronous signal handlers.
References _signalMask, and nidas::core::getSample().
Referenced by DSMServerApp().
nidas::util::Exception |
References _statusThread, and nidas::util::Thread::start().
Referenced by run().
void DSMServerApp::startXmlRpcThread | ( | ) |
nidas::util::Exception |
References _externalControl, _xmlrpcThread, and nidas::util::Thread::start().
Referenced by main().
int DSMServerApp::usage | ( | ) |
Send usage message to cerr.
References _app, nidas::core::NidasApp::getProcessName(), nidas::core::getSample(), and nidas::core::NidasApp::usage().
Referenced by parseRunstring().
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::core::getSample(), ILOG, PLOG, QUIT, RESTART, timeoutSecs, and WLOG.
Referenced by run().
|
private |
Referenced by getDataset(), initLogger(), initProcess(), parseRunstring(), run(), and usage().
|
private |
The xml file that contains all the project configurations, by date.
Referenced by parseRunstring(), and run().
|
private |
Referenced by getDataset(), parseRunstring(), and run().
|
private |
-d option.
If user wants messages on stderr rather than syslog.
|
private |
Referenced by parseRunstring(), and startXmlRpcThread().
|
staticprivate |
Referenced by getInstance().
|
private |
|
private |
Referenced by parseRunstring(), and run().
Referenced by run(), and waitForSignal().
|
private |
Referenced by setupSignals(), and waitForSignal().
|
private |
Referenced by killStatusThread(), and startStatusThread().
|
private |
The xml file that is being used for configuration information.
Referenced by getXMLFileName(), parseRunstring(), and run().
|
private |
This thread provides XML-based Remote Procedure calls.
Referenced by killXmlRpcThread(), run(), and startXmlRpcThread().
|
private |
Referenced by parseRunstring().
|
private |
Referenced by parseRunstring().