C# Class winsw.WrapperService

Inheritance: System.ServiceProcess.ServiceBase, EventLogger
Datei anzeigen Open project: kohsuke/winsw Class Usage Examples

Private Properties

Property Type Description
CopyFile void
HandleFileCopies void
HandleLogfiles void
InitLoggers void
ReadPassword string
SignalShutdownComplete void
SignalShutdownPending void
StartProcess void
StartThread void
StopIt void
ThrowNoSuchService void
WaitForProcessToExit void
printAvailableCommandsInfo void
printHelp void
printVersion void

Public Methods

Method Description
LogEvent ( String message ) : void
LogEvent ( String message, EventLogEntryType type ) : void
Main ( string args ) : int
Run ( string _args, winsw.ServiceDescriptor descriptor = null ) : void

Runs the wrapper.

WrapperService ( ) : System
WrapperService ( winsw.ServiceDescriptor descriptor ) : System

Protected Methods

Method Description
OnShutdown ( ) : void
OnStart ( string _ ) : void
OnStop ( ) : void

Private Methods

Method Description
CopyFile ( string sourceFileName, string destFileName ) : void

File replacement.

HandleFileCopies ( ) : void

Process the file copy instructions, so that we can replace files that are always in use while the service runs.

HandleLogfiles ( ) : void

Handle the creation of the logfiles based on the optional logmode setting.

InitLoggers ( winsw.ServiceDescriptor d, bool enableCLILogging ) : void
ReadPassword ( ) : string
SignalShutdownComplete ( ) : void
SignalShutdownPending ( ) : void
StartProcess ( Process processToStart, string arguments, String executable ) : void
StartThread ( ThreadStart main ) : void

Starts a thread that protects the execution with a try/catch block. It appears that in .NET, unhandled exception in any thread causes the app to terminate http://msdn.microsoft.com/en-us/library/ms228965.aspx

StopIt ( ) : void

Called when we are told by Windows SCM to exit.

ThrowNoSuchService ( ) : void
WaitForProcessToExit ( Process processoWait ) : void
printAvailableCommandsInfo ( ) : void
printHelp ( ) : void
printVersion ( ) : void

Method Details

LogEvent() public method

public LogEvent ( String message ) : void
message String
return void

LogEvent() public method

public LogEvent ( String message, EventLogEntryType type ) : void
message String
type EventLogEntryType
return void

Main() public static method

public static Main ( string args ) : int
args string
return int

OnShutdown() protected method

protected OnShutdown ( ) : void
return void

OnStart() protected method

protected OnStart ( string _ ) : void
_ string
return void

OnStop() protected method

protected OnStop ( ) : void
return void

Run() public static method

Runs the wrapper.
Any unhandled exception
public static Run ( string _args, winsw.ServiceDescriptor descriptor = null ) : void
_args string Arguments. If empty, WinSW will behave in the service mode. Otherwise - CLI mode
descriptor winsw.ServiceDescriptor Service descriptor. If null, it will be initialized within the method. /// In such case configs will be loaded from the XML Configuration File.
return void

WrapperService() public method

public WrapperService ( ) : System
return System

WrapperService() public method

public WrapperService ( winsw.ServiceDescriptor descriptor ) : System
descriptor winsw.ServiceDescriptor
return System