More...
|
virtual void | Log (string status) |
| Log a string, as INFO.
|
virtual void | LogDebug (string message) |
| Log a debug message.- Parameters
-
|
virtual void | LogInfo (string message) |
| Log an info message.- Parameters
-
|
virtual void | LogWarning (string message) |
| Log a warning message.- Parameters
-
|
virtual void | LogFatal (string message) |
| Log a fatal message - service should probably quit.- Parameters
-
|
void | WaitForIntervalFrom (DateTime lastRun) |
| Waits until the next Interval should be fired, taking into account the run-time of the last round.
|
|
static int | RunMain< T > (string[] args) |
| Runs the service via the given arguments, ie either to affect a required service control operation, or with no arguments, as per the SCM.
|
static void | StartTesting () |
| For testability, this sets the service into "test mode".
|
static void | ShouldHaveRunMainFor< T > (string[] args) |
| Tests if the main entry point was run.
|
static void | ResetTestMode () |
| Resets the test mode (this is code to enable testing)
|
|
| Shell () |
void | RunOnce () |
| Runs the main logic once. You MUST override this in your derived service.
|
override void | OnStart (string[] args) |
override void | OnStop () |
override void | OnPause () |
override void | OnShutdown () |
override void | OnContinue () |
void | Run () |
| Runs the main loop once.
|
bool | Stopped () |
| Test if the service has been stopped. Will block whilst the service is paused.
|
virtual ILog | GetLogger () |
| Provide the ILog logger.
|
|
int | Interval [get, protected set] |
| Sets the max interval, in seconds, between calls to your implementation of RunOnce Note that this means that if your RunOnce takes longer than this to run, the service will essentially loop your RunOnce non-stop. Only one RunOnce iteration is done at at a time (ie no concurrency)
|
VersionInfo | Version [get] |
| The current version of the service.
|
bool | RunningOnceFromCLI [get, set] |
| Whether or not the service was invoked from the commandline (as opposed to being invoked via the SCM)
|
string | DisplayName [get, protected set] |
| The name displayed for this service in the SCM MMI snap-in (services.msc)
|
string | CopyrightInformation [get, set] |
| Copyright information for this service.
|
new string | ServiceName [get, set] |
| The short name for the service, typically used to control it via the commandline. This is not the name displayed in services.msc.
|
ServiceState | State [get] |
| Reflects the current state of the service.
|
◆ GetLogger()
virtual ILog PeanutButter.ServiceShell.Shell.GetLogger |
( |
| ) |
|
|
protectedvirtual |
Provide the ILog logger.
- Returns
◆ Log()
virtual void PeanutButter.ServiceShell.Shell.Log |
( |
string | status | ) |
|
|
virtual |
Log a string, as INFO.
- Parameters
-
◆ LogDebug()
virtual void PeanutButter.ServiceShell.Shell.LogDebug |
( |
string | message | ) |
|
|
virtual |
◆ LogFatal()
virtual void PeanutButter.ServiceShell.Shell.LogFatal |
( |
string | message | ) |
|
|
virtual |
◆ LogInfo()
virtual void PeanutButter.ServiceShell.Shell.LogInfo |
( |
string | message | ) |
|
|
virtual |
◆ LogWarning()
virtual void PeanutButter.ServiceShell.Shell.LogWarning |
( |
string | message | ) |
|
|
virtual |
◆ RunMain< T >()
int PeanutButter.ServiceShell.Shell.RunMain< T > |
( |
string[] | args | ) |
|
|
static |
Runs the service via the given arguments, ie either to affect a required service control operation, or with no arguments, as per the SCM.
- Parameters
-
- Template Parameters
-
- Returns
◆ RunOnce()
void PeanutButter.ServiceShell.Shell.RunOnce |
( |
| ) |
|
|
abstractprotected |
Runs the main logic once. You MUST override this in your derived service.
- Exceptions
-
◆ ShouldHaveRunMainFor< T >()
void PeanutButter.ServiceShell.Shell.ShouldHaveRunMainFor< T > |
( |
string[] | args | ) |
|
|
static |
Tests if the main entry point was run.
- Parameters
-
- Template Parameters
-
- Exceptions
-
◆ Stopped()
bool PeanutButter.ServiceShell.Shell.Stopped |
( |
| ) |
|
|
protected |
Test if the service has been stopped. Will block whilst the service is paused.
- Returns
◆ WaitForIntervalFrom()
void PeanutButter.ServiceShell.Shell.WaitForIntervalFrom |
( |
DateTime | lastRun | ) |
|
Waits until the next Interval should be fired, taking into account the run-time of the last round.
- Parameters
-
◆ ServiceName
new string PeanutButter.ServiceShell.Shell.ServiceName |
|
getset |
The short name for the service, typically used to control it via the commandline. This is not the name displayed in services.msc.
- Exceptions
-
The documentation for this class was generated from the following file:
- source/Win32Service/PeanutButter.ServiceShell/Shell.cs