Resvolution - WIP running without Resolution
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
using LightInject;
|
||||
using Umbraco.Core.Cache;
|
||||
using Umbraco.Core.Components;
|
||||
using Umbraco.Core.Persistence.UnitOfWork;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Core.Strings;
|
||||
using Umbraco.Core.DependencyInjection;
|
||||
|
||||
namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
{
|
||||
[DisableComponent] // is not enabled by default
|
||||
public class XmlCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
|
||||
{
|
||||
public override void Compose(ServiceContainer container)
|
||||
{
|
||||
base.Compose(container);
|
||||
|
||||
// register the XML facade service
|
||||
container.RegisterSingleton<IFacadeService>(factory => new FacadeService(
|
||||
factory.GetInstance<ServiceContext>(),
|
||||
factory.GetInstance<IDatabaseUnitOfWorkProvider>(),
|
||||
factory.GetInstance<CacheHelper>().RequestCache,
|
||||
factory.GetAllInstances<IUrlSegmentProvider>(),
|
||||
factory.GetInstance<IFacadeAccessor>()));
|
||||
}
|
||||
|
||||
public void Initialize(IFacadeService service)
|
||||
{
|
||||
// nothing - this just ensures that the service is created at boot time
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,6 @@ using Umbraco.Core.IO;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.ObjectResolution;
|
||||
using Umbraco.Core.Persistence;
|
||||
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
|
||||
using Umbraco.Core.Persistence.Repositories;
|
||||
@@ -92,11 +91,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
InitializeFilePersister();
|
||||
}
|
||||
|
||||
// need to wait for resolution to be frozen
|
||||
if (Resolution.IsFrozen)
|
||||
OnResolutionFrozen(testing, enableRepositoryEvents);
|
||||
else
|
||||
Resolution.Frozen += (sender, args) => OnResolutionFrozen(testing, enableRepositoryEvents);
|
||||
Initialize(testing, enableRepositoryEvents);
|
||||
}
|
||||
|
||||
// internal for unit tests
|
||||
@@ -169,7 +164,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
|
||||
_released = (registered == false);
|
||||
}
|
||||
|
||||
private void OnResolutionFrozen(bool testing, bool enableRepositoryEvents)
|
||||
private void Initialize(bool testing, bool enableRepositoryEvents)
|
||||
{
|
||||
if (testing == false || enableRepositoryEvents)
|
||||
InitializeRepositoryEvents();
|
||||
|
||||
Reference in New Issue
Block a user