2016-10-07 14:34:55 +02:00
|
|
|
|
using Umbraco.Core;
|
2016-08-31 16:48:57 +02:00
|
|
|
|
using Umbraco.Core.Components;
|
|
|
|
|
|
using Umbraco.Core.Logging;
|
|
|
|
|
|
using Umbraco.Core.Persistence.UnitOfWork;
|
2017-05-12 14:49:44 +02:00
|
|
|
|
using Umbraco.Core.Scoping;
|
2016-08-31 16:48:57 +02:00
|
|
|
|
using Umbraco.Core.Services;
|
2017-05-22 17:22:10 +02:00
|
|
|
|
using LightInject;
|
2016-08-31 16:48:57 +02:00
|
|
|
|
|
|
|
|
|
|
namespace Umbraco.Web.PublishedCache.NuCache
|
|
|
|
|
|
{
|
|
|
|
|
|
public class NuCacheComponent : UmbracoComponentBase, IUmbracoCoreComponent
|
|
|
|
|
|
{
|
2016-10-07 14:34:55 +02:00
|
|
|
|
public override void Compose(Composition composition)
|
2016-08-31 16:48:57 +02:00
|
|
|
|
{
|
2016-10-07 14:34:55 +02:00
|
|
|
|
base.Compose(composition);
|
2016-08-31 16:48:57 +02:00
|
|
|
|
|
|
|
|
|
|
// register the NuCache facade service
|
2016-10-07 14:34:55 +02:00
|
|
|
|
composition.SetFacadeService(factory => new FacadeService(
|
2016-08-31 16:48:57 +02:00
|
|
|
|
new FacadeService.Options { FacadeCacheIsApplicationRequestCache = true },
|
2016-09-01 19:06:08 +02:00
|
|
|
|
factory.GetInstance<MainDom>(),
|
|
|
|
|
|
factory.GetInstance<IRuntimeState>(),
|
2016-08-31 16:48:57 +02:00
|
|
|
|
factory.GetInstance<ServiceContext>(),
|
2017-05-12 14:49:44 +02:00
|
|
|
|
factory.GetInstance<IScopeUnitOfWorkProvider>(),
|
2016-08-31 16:48:57 +02:00
|
|
|
|
factory.GetInstance<IFacadeAccessor>(),
|
2017-05-12 14:49:44 +02:00
|
|
|
|
factory.GetInstance<ILogger>(),
|
|
|
|
|
|
factory.GetInstance<IScopeProvider>()));
|
2016-09-08 18:43:58 +02:00
|
|
|
|
|
|
|
|
|
|
// add the NuCache health check (hidden from type finder)
|
|
|
|
|
|
// todo - no NuCache health check yet
|
2016-10-07 14:34:55 +02:00
|
|
|
|
//composition.HealthChecks().Add<NuCacheIntegrityHealthCheck>();
|
2016-08-31 16:48:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Initialize(IFacadeService service)
|
|
|
|
|
|
{
|
|
|
|
|
|
// nothing - this just ensures that the service is created at boot time
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|