Ejemplo n.º 1
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.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;
            }
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 3
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;
            }
        }
Ejemplo n.º 4
0
 private bool RunComponent(SnComponentInfo component)
 {
     try
     {
         RepositoryVersionInfo.CheckComponentVersions(new[] { component }, true);
         return(true);
     }
     catch (InvalidOperationException e)
     {
         if (e.Message.Contains("component is missing."))
         {
             return(false);
         }
         throw;
     }
     catch (ApplicationException e)
     {
         if (e.Message.Contains("Component and assembly version mismatch."))
         {
             return(false);
         }
         throw;
     }
 }