C# Class winsw.WrapperService

Inheritance: System.ServiceProcess.ServiceBase, EventLogger
Afficher le fichier Open project: kohsuke/winsw Class Usage Examples

Private Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode Description
OnShutdown ( ) : void
OnStart ( string _ ) : void
OnStop ( ) : void

Private Methods

Méthode 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 méthode

public LogEvent ( String message ) : void
message String
Résultat void

LogEvent() public méthode

public LogEvent ( String message, EventLogEntryType type ) : void
message String
type EventLogEntryType
Résultat void

Main() public static méthode

public static Main ( string args ) : int
args string
Résultat int

OnShutdown() protected méthode

protected OnShutdown ( ) : void
Résultat void

OnStart() protected méthode

protected OnStart ( string _ ) : void
_ string
Résultat void

OnStop() protected méthode

protected OnStop ( ) : void
Résultat void

Run() public static méthode

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.
Résultat void

WrapperService() public méthode

public WrapperService ( ) : System
Résultat System

WrapperService() public méthode

public WrapperService ( winsw.ServiceDescriptor descriptor ) : System
descriptor winsw.ServiceDescriptor
Résultat System