protected virtual void InitializeRuntime() { if (ManagementApplication.HasRuntime(this)) { return; } lock (MobiHttpApplicationInitializeRuntimeLockObject) { //string name = HostingEnvironment.SiteName; if (ManagementApplication.HasRuntime(this)) { return; } this._baseApplication = new ApplicationBase(MobiChat.Data.Application.CreateManager().Load(2)); if (this._baseApplication == null) { //Log.Fatal(new LogMessageBuilder(new LogErrorCode("paywall.web.core", "paywallhttpapplication", "initializeruntime"), // string.Format("Application {0} is not loaded.", HostingEnvironment.SiteName), application)); throw new InvalidOperationException(string.Format("No application with name '{0}' registered in database.", HostingEnvironment.SiteName)); } IRuntime runtime = this._baseApplication.ApplicationData.InstantiateRuntime(); if (!runtime.Initialize(HostingEnvironment.SiteName)) { return; } ManagementApplication.SetRuntime(this, runtime); //Log.Debug(new LogMessageBuilder(new LogErrorCode("paywall.web.core", "paywallhttpapplication", "initialize"), "Application initialized!", application.Name)); // TODO: Fix this // outeConfig.RegisterRoutes(this); this.InitializeApplication(); } //Log.Info(new LogMessageBuilder(new LogErrorCode("paywall.web.core", "paywallhttpapplication", "initializeruntime"), // "Initialization of PaywallHttpApplication(" + HostingEnvironment.SiteName + ") is complete")); return; }
protected static void SetRuntime(HttpApplication application, IRuntime runtime) { ManagementApplication.SetRuntime(application.Application, runtime); }
protected static void SetRuntime(HttpContext context, IRuntime runtime) { ManagementApplication.SetRuntime(context.Application, runtime); }