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;
|
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;
|
2017-10-17 17:43:15 +02:00
|
|
|
|
using Umbraco.Core.Models.PublishedContent;
|
2017-12-14 17:04:44 +01:00
|
|
|
|
using Umbraco.Core.Persistence.Repositories;
|
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
|
|
|
|
|
2017-10-31 12:48:24 +01:00
|
|
|
|
// register the NuCache published snapshot service
|
|
|
|
|
|
composition.SetPublishedSnapshotService(factory => new PublishedSnapshotService(
|
|
|
|
|
|
new PublishedSnapshotService.Options(),
|
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-10-17 17:43:15 +02:00
|
|
|
|
factory.GetInstance<IPublishedContentTypeFactory>(),
|
2017-10-31 12:48:24 +01:00
|
|
|
|
factory.GetInstance<IPublishedSnapshotAccessor>(),
|
2017-05-12 14:49:44 +02:00
|
|
|
|
factory.GetInstance<ILogger>(),
|
2017-12-14 17:04:44 +01:00
|
|
|
|
factory.GetInstance<IScopeProvider>(),
|
|
|
|
|
|
factory.GetInstance<IDocumentRepository>(),
|
|
|
|
|
|
factory.GetInstance<IMediaRepository>(),
|
|
|
|
|
|
factory.GetInstance<IMemberRepository>()));
|
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
|
|
|
|
}
|
|
|
|
|
|
|
2017-10-31 12:48:24 +01:00
|
|
|
|
public void Initialize(IPublishedSnapshotService service)
|
2016-08-31 16:48:57 +02:00
|
|
|
|
{
|
|
|
|
|
|
// nothing - this just ensures that the service is created at boot time
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|