protected virtual void OnEnd() { BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor != null) { backgroundServicesExecutor.Stop(); } }
protected void Application_End(object sender, EventArgs e) { BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor != null) { backgroundServicesExecutor.Stop(); } }
public void Cleanup(IDictionary <string, object> state) { BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)(state.ContainsKey("backgroundServicesExecutor") ? state["backgroundServicesExecutor"] : null); if (backgroundServicesExecutor != null) { backgroundServicesExecutor.Stop(); } }
public void Execute(IDictionary <string, object> state) { Site site = container.Resolve <Site>(); if (site.ID != Guid.Empty) { BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)(state.ContainsKey("backgroundServicesExecutor") ? state["backgroundServicesExecutor"] : null); if (backgroundServicesExecutor == null) { state["backgroundServicesExecutor"] = backgroundServicesExecutor = new BackgroundServicesExecutor(container); backgroundServicesExecutor.Start(); } } }
private void launchBackgroundServices() { IUnityContainer container = getContainer(); Site site = getSite(container); if (site.ID != Guid.Empty) { BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor == null) { backgroundServicesExecutor = new BackgroundServicesExecutor(container); Application.Add("backgroundServicesExecutor", backgroundServicesExecutor); backgroundServicesExecutor.Start(); } } }
private void launchBackgroundServices() { if (!System.IO.File.Exists(EyouSoft.Common.Utility.GetMapPath("/Config/BackgroundServices.txt"))) { return; } IUnityContainer container = (IUnityContainer)Application["container"]; BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor == null) { backgroundServicesExecutor = new BackgroundServicesExecutor(container); Application.Add("backgroundServicesExecutor", backgroundServicesExecutor); backgroundServicesExecutor.Start(); } }
/// <summary> /// 启动 background services /// </summary> private void LaunchBackgroundServices() { if (!System.IO.File.Exists(Toolkit.Utils.GetMapPath("/Config/BackgroundServices.txt"))) { return; } var container = (IUnityContainer)Application["container"]; var backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor == null) { backgroundServicesExecutor = new BackgroundServicesExecutor(container, BackgroundServicesItem.短信中心); Application.Add("backgroundServicesExecutor", backgroundServicesExecutor); backgroundServicesExecutor.Start(); } }
/// <summary> /// launch background services /// </summary> private void launchBackgroundServices() { if (!System.IO.File.Exists(EyouSoft.Toolkit.Utils.GetMapPath("/Config/BackgroundServices.txt"))) { return; } IUnityContainer container = (IUnityContainer)Application["container"]; BackgroundServicesExecutor backgroundServicesExecutor = (BackgroundServicesExecutor)Application["backgroundServicesExecutor"]; if (backgroundServicesExecutor == null) { backgroundServicesExecutor = new BackgroundServicesExecutor(container); Application.Add("backgroundServicesExecutor", backgroundServicesExecutor); backgroundServicesExecutor.Start(); EyouSoft.Services.BackgroundServices.SmsUtils.WLog("后台服务开启", "/Config/BackgroundServicesLog.txt"); } }