/// <summary> /// /// </summary> /// <see cref="AppServerBase.OnStop(AppServerBase.StartStopContext, ref bool)" /> protected override void OnStop(AppServerBase.StartStopContext context, ref bool isRunning) { const string LOG_TAG_PREFIX = "ApplicationServer::OnStop::"; this.DisposeOldWebInterfaceServer(); var moduleList = this.Modules; if (moduleList == null) { return; } var ex = moduleList.Where(m => m.CanStop) .ForAllAsync(ctx => { var m = ctx.Item; m.Stop(); }, throwExceptions: false); if (ex != null) { this.Logger .Log(msg: ex, tag: LOG_TAG_PREFIX + "StopModules", categories: LoggerFacadeCategories.Errors); } }
/// <summary> /// /// </summary> /// <see cref="AppServerBase.OnStart(AppServerBase.StartStopContext, ref bool)" /> protected override void OnStart(AppServerBase.StartStopContext context, ref bool isRunning) { const string LOG_TAG_PREFIX = "ApplicationServer::OnStart::"; AggregateException ex = null; switch (context) { case StartStopContext.Start: this.StartServer(); break; case StartStopContext.Restart: var moduleList = this.Modules; if (moduleList != null) { ex = moduleList.Where(m => m.CanRestart) .ForAllAsync(ctx => { var m = ctx.Item; m.Restart(); }, throwExceptions: false); if (ex != null) { this.Logger .Log(msg: ex, tag: LOG_TAG_PREFIX + "Restart", categories: LoggerFacadeCategories.Errors); } } else { this.StartServer(); } break; } }