#include <daemon_windows.h>
Public Member Functions | |
Service () | |
~Service () | |
void | start (int &argc, char **&argv) |
void | tracefile (const char *val) |
Set _tracefile. | |
void | pidfile (const char *val) |
Set _pidfile. | |
void | foreground (bool val) |
Set _foreground. | |
void | daemonize () |
Redirects output streams to tracefile. | |
void | runningOk () |
Called to signal that all startup operations have completed OK. | |
void | shutdown () |
Exit handler set with on_exit() - shuts down the service. | |
Static Public Member Functions | |
static void | log (const char *message) |
Callback, used as a parameter to omniORB::setLogFunction(). | |
static void | ctrlHandler (DWORD controlCode) |
Handles control codes from the Service Control Manager. | |
Private Member Functions | |
void | Service::setArgcArgv (int &argc, char **&argv) |
void | install (int argc, char **argv) const |
void | uninstall () const |
void | readParameters () |
Populates _parameters from the Registry. | |
void | writeParameters (int argc, char **argv) const |
Writes args 2+ to the Registry. | |
bool | Service::setServiceStatus (DWORD currentState, DWORD win32ExitCode, DWORD serviceSpecificExitCode, DWORD checkPoint, DWORD waitHint) |
Private Attributes | |
char * | _tracefile |
The tracefile name (if any). | |
const char * | _regSubKey |
bool | _serviceRunning |
int | _callCount |
char * | _parameters |
Stores parameters read from the registry. | |
char ** | _argv |
Replacement argv array, read from registry. | |
std::ostream * | _logstream |
SERVICE_STATUS_HANDLE | _serviceStatusHandle |
Windows thing. |
Definition at line 40 of file daemon_windows.h.
OmniEvents::Service::Service | ( | ) |
Definition at line 180 of file daemon_windows.cc.
OmniEvents::Service::~Service | ( | ) |
Definition at line 192 of file daemon_windows.cc.
References _argv, _logstream, _parameters, and _tracefile.
void OmniEvents::Service::start | ( | int & | argc, | |
char **& | argv | |||
) |
Definition at line 223 of file daemon_windows.cc.
References _callCount, _parameters, _serviceRunning, _serviceStatusHandle, ctrlHandler(), HERE, install(), main(), PACKAGE_NAME, OmniEvents::Win::perror(), readParameters(), uninstall(), and writeParameters().
void OmniEvents::Service::tracefile | ( | const char * | val | ) |
void OmniEvents::Service::pidfile | ( | const char * | val | ) |
void OmniEvents::Service::foreground | ( | bool | val | ) |
void OmniEvents::Service::daemonize | ( | ) |
Redirects output streams to tracefile.
Definition at line 292 of file daemon_windows.cc.
References _logstream, _tracefile, log(), omniORB::setLogFunction(), and OmniEvents::shutdown0().
void OmniEvents::Service::runningOk | ( | ) |
Called to signal that all startup operations have completed OK.
Definition at line 309 of file daemon_windows.cc.
References _serviceRunning.
void OmniEvents::Service::shutdown | ( | ) |
Exit handler set with on_exit() - shuts down the service.
Definition at line 319 of file daemon_windows.cc.
References _logstream, and _serviceRunning.
void OmniEvents::Service::log | ( | const char * | message | ) | [static] |
Callback, used as a parameter to omniORB::setLogFunction().
Definition at line 334 of file daemon_windows.cc.
References _logstream, and OmniEvents::service.
Referenced by daemonize(), foreground(), OmniEvents::Win::perror(), and pidfile().
void OmniEvents::Service::ctrlHandler | ( | DWORD | controlCode | ) | [static] |
Handles control codes from the Service Control Manager.
Definition at line 340 of file daemon_windows.cc.
References OmniEvents_Orb_bumpTraceLevel(), OmniEvents_Orb_shutdown(), and OmniEvents::service.
Referenced by start().
void OmniEvents::Service::Service::setArgcArgv | ( | int & | argc, | |
char **& | argv | |||
) | [private] |
void OmniEvents::Service::install | ( | int | argc, | |
char ** | argv | |||
) | const [private] |
Definition at line 383 of file daemon_windows.cc.
References _regSubKey, HERE, PACKAGE_NAME, OmniEvents::Win::perror(), OmniEvents::service, OmniEvents::RegistryKey::setValueStr(), and writeParameters().
Referenced by start().
void OmniEvents::Service::uninstall | ( | ) | const [private] |
Definition at line 448 of file daemon_windows.cc.
References HERE, PACKAGE_NAME, OmniEvents::Win::perror(), and OmniEvents::service.
Referenced by start().
void OmniEvents::Service::readParameters | ( | ) | [private] |
Populates _parameters from the Registry.
Definition at line 485 of file daemon_windows.cc.
References _regSubKey, HERE, OmniEvents::Win::perror(), and OmniEvents::RegistryKey::queryValueStr().
Referenced by start().
void OmniEvents::Service::writeParameters | ( | int | argc, | |
char ** | argv | |||
) | const [private] |
Writes args 2+ to the Registry.
Definition at line 502 of file daemon_windows.cc.
References _regSubKey, HERE, OmniEvents::Win::perror(), and OmniEvents::RegistryKey::setValueStr().
bool OmniEvents::Service::Service::setServiceStatus | ( | DWORD | currentState, | |
DWORD | win32ExitCode, | |||
DWORD | serviceSpecificExitCode, | |||
DWORD | checkPoint, | |||
DWORD | waitHint | |||
) | [private] |
char* OmniEvents::Service::_tracefile [private] |
The tracefile name (if any).
Definition at line 70 of file daemon_windows.h.
Referenced by daemonize(), tracefile(), and ~Service().
const char* OmniEvents::Service::_regSubKey [private] |
Definition at line 71 of file daemon_windows.h.
Referenced by install(), readParameters(), and writeParameters().
bool OmniEvents::Service::_serviceRunning [private] |
int OmniEvents::Service::_callCount [private] |
char* OmniEvents::Service::_parameters [private] |
Stores parameters read from the registry.
Definition at line 74 of file daemon_windows.h.
Referenced by start(), and ~Service().
char** OmniEvents::Service::_argv [private] |
Replacement argv array, read from registry.
Definition at line 75 of file daemon_windows.h.
Referenced by ~Service().
std::ostream* OmniEvents::Service::_logstream [private] |
Definition at line 76 of file daemon_windows.h.
Referenced by daemonize(), log(), shutdown(), and ~Service().
SERVICE_STATUS_HANDLE OmniEvents::Service::_serviceStatusHandle [private] |