C# 클래스 Candor.Tasks.ServiceProcess.ServiceMonitorWorkerRoleTask

Monitors that a service is up either directly or by checking for updates to a file that it generates. When a monitored service stops working, attempts are made to restart the service or the server it runs on.
The service being monitored can be on any machine in the same domain. If not on a domain, then only the current machine can be monitored and restarted.
상속: RepeatingWorkerRoleTask
파일 보기 프로젝트 열기: michael-lang/candor-common

공개 메소드들

메소드 설명
Initialize ( string name, NameValueCollection configValue ) : void

Initializes the provider with the specified values.

OnWaitingPeriodElapsed ( ) : void

The code to be executed everytime the waiting period elapses.

This will complete before the waiting period until the next iteration begins.

보호된 메소드들

메소드 설명
AssertConfigurationValid ( ) : void

Ensures the configuration is valid, otherwise it throws an ArgumentException.

FormatServerName ( string name ) : string

Formats a server name for use by management API to restart the server.

GetExpectedAgeMinutes ( ) : Int32

Gets the expected file age in minutes, or the max file age if the expected age is not specified.

IsMonitorEnabled ( ) : bool

Possible expansion point to disable the service monitor at preconfigured times.

RestartServer ( ) : bool

Force Restarts the service, if possible.

RestartService ( ) : bool

Restarts the windows service, if possible.

ValidateServiceFile ( ) : bool

Validates that a service file exists, and if not it is logged. A custom logger should be provided to notify the appropriate party.

ValidateWindowsService ( ) : bool

Validates if a windows service is running.

메소드 상세

AssertConfigurationValid() 보호된 메소드

Ensures the configuration is valid, otherwise it throws an ArgumentException.
protected AssertConfigurationValid ( ) : void
리턴 void

FormatServerName() 보호된 메소드

Formats a server name for use by management API to restart the server.
protected FormatServerName ( string name ) : string
name string
리턴 string

GetExpectedAgeMinutes() 보호된 메소드

Gets the expected file age in minutes, or the max file age if the expected age is not specified.
protected GetExpectedAgeMinutes ( ) : Int32
리턴 System.Int32

Initialize() 공개 메소드

Initializes the provider with the specified values.
public Initialize ( string name, NameValueCollection configValue ) : void
name string The name of the provider.
configValue System.Collections.Specialized.NameValueCollection Provider specific attributes.
리턴 void

IsMonitorEnabled() 보호된 메소드

Possible expansion point to disable the service monitor at preconfigured times.
protected IsMonitorEnabled ( ) : bool
리턴 bool

OnWaitingPeriodElapsed() 공개 메소드

The code to be executed everytime the waiting period elapses.
This will complete before the waiting period until the next iteration begins.
public OnWaitingPeriodElapsed ( ) : void
리턴 void

RestartServer() 보호된 메소드

Force Restarts the service, if possible.
protected RestartServer ( ) : bool
리턴 bool

RestartService() 보호된 메소드

Restarts the windows service, if possible.
protected RestartService ( ) : bool
리턴 bool

ValidateServiceFile() 보호된 메소드

Validates that a service file exists, and if not it is logged. A custom logger should be provided to notify the appropriate party.
protected ValidateServiceFile ( ) : bool
리턴 bool

ValidateWindowsService() 보호된 메소드

Validates if a windows service is running.
protected ValidateWindowsService ( ) : bool
리턴 bool