2018-04-18 19:46:47 +02:00
|
|
|
|
using Umbraco.Core.Components;
|
|
|
|
|
|
using Umbraco.Web.PublishedCache.NuCache.DataSource;
|
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
|
|
|
|
|
2018-04-18 19:46:47 +02:00
|
|
|
|
// register the NuCache database data source
|
|
|
|
|
|
composition.Container.Register<IDataSource, DatabaseDataSource>();
|
|
|
|
|
|
|
2017-10-31 12:48:24 +01:00
|
|
|
|
// register the NuCache published snapshot service
|
2018-03-30 14:00:44 +02:00
|
|
|
|
// must register default options, required in the service ctor
|
|
|
|
|
|
composition.Container.Register(factory => new PublishedSnapshotService.Options());
|
|
|
|
|
|
composition.SetPublishedSnapshotService<PublishedSnapshotService>();
|
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
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|