public override void OnWaitingPeriodElapsed()
{
AssertConfigurationValid();
if (!IsMonitorEnabled())
{
LogProvider.DebugFormat("This service monitor is disabled at this time: {0}", Name);
return;
}
bool ok = ValidateServiceFile() && ValidateWindowsService();
if (!ok)
ok = RestartService();
if (!ok)
ok = RestartServer();
if (!ok)
{
LogProvider.WarnFormat("Non-functional service could not be restarted, '{0}'.", Name);
}
else
{
LogProvider.DebugFormat("Functional service '{0}'.", Name);
}
}