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
Показать файл Открыть проект

Открытые методы

Метод Описание
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