Exemple #1
0
        /* ============================================================================================================ static handlers */
        protected static void ApplicationStartHandler(object sender, EventArgs e, HttpApplication application)
        {
            var runOnceMarkerPath = application.Server.MapPath("/" + RunOnceGuid);
            var firstRun          = File.Exists(runOnceMarkerPath);
            var startConfig       = new SenseNet.ContentRepository.RepositoryStartSettings {
                StartLuceneManager = !firstRun
            };

            RepositoryInstance.WaitForWriterLockFileIsReleased(RepositoryInstance.WaitForLockFileType.OnStart);

            Repository.Start(startConfig);

            //-- <L2Cache>
            StorageContext.L2Cache = new L2CacheImpl();
            //-- </L2Cache>

            RegisterRoutes(RouteTable.Routes);
            RepositoryPathProvider.Register();

            //Database.SetInitializer(new InDocContextInitializer());

            //using (var context = DependencyResolver.Current.GetService<InDocContext>())
            //{
            //    context.Database.Initialize(false);
            //}

            //preload
            WarmUp.Preload();
        }
Exemple #2
0
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            using (var op = SnTrace.Repository.StartOperation("Application_Start. Process: {0}, AppDomain: {1}, ",
                                                              System.Diagnostics.Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id))
            {
                var repositoryBuilder = new RepositoryBuilder
                {
                    IsWebContext = true,
                };

                Providers.Instance.CompatibilitySupport = new CompatibilitySupport();

                BuildRepository(repositoryBuilder);

                Repository.Start(repositoryBuilder);

                RepositoryVersionInfo.CheckComponentVersions();

                StorageContext.L2Cache = new L2CacheImpl();

                RegisterRoutes(RouteTable.Routes, application);
                RepositoryPathProvider.Register();

                op.Successful = true;
            }
        }
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            using (var op = SnTrace.Repository.StartOperation("Application_Start. Process: {0}, AppDomain: {1}, ",
                                                              System.Diagnostics.Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id))
            {
                var repositoryBuilder = new RepositoryBuilder
                {
                    IsWebContext = true,
                };

                Providers.Instance.PropertyCollector    = new ContextEventPropertyCollector();
                Providers.Instance.CompatibilitySupport = new CompatibilitySupport();

                // use real users in a web environment if not configured
                if (Providers.Instance.AccessProvider is DesktopAccessProvider)
                {
                    repositoryBuilder.UseAccessProvider(new UserAccessProvider());
                }

                BuildRepository(repositoryBuilder);

                Repository.Start(repositoryBuilder);

                RepositoryVersionInfo.CheckComponentVersions();

                StorageContext.L2Cache = new L2CacheImpl();

                RegisterRoutes(RouteTable.Routes, application);
                RepositoryPathProvider.Register();

                op.Successful = true;
            }
        }
Exemple #4
0
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            var op = DetailedLogger.CreateOperation();   // category: general

            DetailedLogger.Log(op, "Application_Start"); // category: general

            var runOnceMarkerPath = application.Server.MapPath("/" + RunOnceGuid);
            var firstRun          = File.Exists(runOnceMarkerPath);
            var startConfig       = new ContentRepository.RepositoryStartSettings {
                StartLuceneManager = !firstRun
            };

            RepositoryInstance.WaitForWriterLockFileIsReleased(RepositoryInstance.WaitForLockFileType.OnStart);

            Repository.Start(startConfig);

            //-- <L2Cache>
            StorageContext.L2Cache = new L2CacheImpl();
            //-- </L2Cache>

            GlobalConfiguration.Configure(WebApiConfiguration.Register);
            RegisterRoutes(RouteTable.Routes, application);
            RepositoryPathProvider.Register();

            //preload
            WarmUp.Preload();

            op.Finish(); // category: general
        }
Exemple #5
0
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            using (var op = SnTrace.Repository.StartOperation("Application_Start. Process: {0}, AppDomain: {1}, ",
                                                              System.Diagnostics.Process.GetCurrentProcess().Id, AppDomain.CurrentDomain.Id))
            {
                var runOnceMarkerPath = application.Server.MapPath("/" + RunOnceGuid);
                var firstRun          = File.Exists(runOnceMarkerPath);
                var startConfig       = new RepositoryStartSettings {
                    StartLuceneManager = !firstRun, IsWebContext = true
                };

                RepositoryInstance.WaitForWriterLockFileIsReleased(RepositoryInstance.WaitForLockFileType.OnStart);

                Repository.Start(startConfig);

                RepositoryVersionInfo.CheckComponentVersions();

                StorageContext.L2Cache = new L2CacheImpl();

                RegisterRoutes(RouteTable.Routes, application);
                RepositoryPathProvider.Register();

                op.Successful = true;
            }
        }
Exemple #6
0
        protected virtual void Application_Start(object sender, EventArgs e, HttpApplication application)
        {
            var runOnceMarkerPath = application.Server.MapPath("/" + RunOnceGuid);
            var firstRun          = File.Exists(runOnceMarkerPath);
            var startConfig       = new SenseNet.ContentRepository.RepositoryStartSettings {
                StartLuceneManager = !firstRun
            };

            RepositoryInstance.WaitForWriterLockFileIsReleased(RepositoryInstance.WaitForLockFileType.OnStart);

            Repository.Start(startConfig);

            //-- <L2Cache>
            StorageContext.L2Cache = new L2CacheImpl();
            //-- </L2Cache>

            RegisterRoutes(RouteTable.Routes, application);
            RepositoryPathProvider.Register();

            //preload
            WarmUp.Preload();
        }