protected virtual void InitializeRuntime() { if (StatisticsApplication.HasRuntime(this)) { return; } lock (MobiHttpApplicationInitializeRuntimeLockObject) { //string name = HostingEnvironment.SiteName; if (StatisticsApplication.HasRuntime(this)) { return; } Data.Application application = MobiChat.Data.Application.CreateManager().Load(HostingEnvironment.SiteName); // SUMMARY: for testing from local if (application == null && HostingEnvironment.SiteName.Equals("MobiChat.Statistics")) { application = MobiChat.Data.Application.CreateManager().Load(5); } if (application == null) { //Log.Fatal(string.Format("Application {0} is not loaded.", HostingEnvironment.SiteName)); throw new InvalidOperationException(string.Format("No application with name '{0}' registered in database.", HostingEnvironment.SiteName)); } this._baseApplication = new ApplicationBase(application); IRuntime runtime = this._baseApplication.ApplicationData.InstantiateRuntime(); if (!runtime.Initialize(HostingEnvironment.SiteName)) { return; } StatisticsApplication.SetRuntime(this, runtime); Log.Debug(string.Format("Application {0} initialized!", HostingEnvironment.SiteName)); this.InitializeApplication(); } return; }
protected static void SetRuntime(HttpApplication application, IRuntime runtime) { StatisticsApplication.SetRuntime(application.Application, runtime); }
protected static void SetRuntime(HttpContext context, IRuntime runtime) { StatisticsApplication.SetRuntime(context.Application, runtime); }