diff --git a/src/Umbraco.Core/Hosting/IHostingEnvironmentLifetime.cs b/src/Umbraco.Core/Hosting/IApplicationShutdownRegistry.cs
similarity index 78%
rename from src/Umbraco.Core/Hosting/IHostingEnvironmentLifetime.cs
rename to src/Umbraco.Core/Hosting/IApplicationShutdownRegistry.cs
index 891cedad20..93441f1a47 100644
--- a/src/Umbraco.Core/Hosting/IHostingEnvironmentLifetime.cs
+++ b/src/Umbraco.Core/Hosting/IApplicationShutdownRegistry.cs
@@ -1,6 +1,6 @@
namespace Umbraco.Core.Hosting
{
- public interface IHostingEnvironmentLifetime
+ public interface IApplicationShutdownRegistry
{
void RegisterObject(IRegisteredObject registeredObject);
void UnregisterObject(IRegisteredObject registeredObject);
diff --git a/src/Umbraco.Core/Runtime/IMainDom.cs b/src/Umbraco.Core/Runtime/IMainDom.cs
index 1b7f09bc89..93a560ff7d 100644
--- a/src/Umbraco.Core/Runtime/IMainDom.cs
+++ b/src/Umbraco.Core/Runtime/IMainDom.cs
@@ -26,7 +26,7 @@ namespace Umbraco.Core
///
///
///
- bool Acquire(IHostingEnvironmentLifetime hostingEnvironment);
+ bool Acquire(IApplicationShutdownRegistry hostingEnvironment);
///
/// Registers a resource that requires the current AppDomain to be the main domain to function.
diff --git a/src/Umbraco.Core/Runtime/MainDom.cs b/src/Umbraco.Core/Runtime/MainDom.cs
index 0a4a250aa6..81db1b700d 100644
--- a/src/Umbraco.Core/Runtime/MainDom.cs
+++ b/src/Umbraco.Core/Runtime/MainDom.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Core.Runtime
#region Vars
private readonly ILogger _logger;
- private IHostingEnvironmentLifetime _hostingEnvironment;
+ private IApplicationShutdownRegistry _hostingEnvironment;
private readonly IMainDomLock _mainDomLock;
// our own lock for local consistency
@@ -50,9 +50,10 @@ namespace Umbraco.Core.Runtime
#endregion
- public bool Acquire(IHostingEnvironmentLifetime hostingEnvironment)
+ public bool Acquire(IApplicationShutdownRegistry hostingEnvironment)
{
- _hostingEnvironment = hostingEnvironment;
+ _hostingEnvironment = hostingEnvironment ?? throw new ArgumentNullException(nameof(hostingEnvironment));
+
return LazyInitializer.EnsureInitialized(ref _isMainDom, ref _isInitialized, ref _locko, () =>
{
hostingEnvironment.RegisterObject(this);
@@ -199,7 +200,7 @@ namespace Umbraco.Core.Runtime
// The web app is stopping, need to wind down
Dispose(true);
- _hostingEnvironment.UnregisterObject(this);
+ _hostingEnvironment?.UnregisterObject(this);
}
#region IDisposable Support
diff --git a/src/Umbraco.Core/SimpleMainDom.cs b/src/Umbraco.Core/SimpleMainDom.cs
index 52ed6c1d91..e6bdda67d7 100644
--- a/src/Umbraco.Core/SimpleMainDom.cs
+++ b/src/Umbraco.Core/SimpleMainDom.cs
@@ -18,7 +18,7 @@ namespace Umbraco.Core
public bool IsMainDom { get; private set; } = true;
// always acquire
- public bool Acquire(IHostingEnvironmentLifetime hostingEnvironment) => true;
+ public bool Acquire(IApplicationShutdownRegistry hostingEnvironment) => true;
///
public bool Register(Action release, int weight = 100)
diff --git a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs
index 4e183b9211..6c745f3877 100644
--- a/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs
+++ b/src/Umbraco.Infrastructure/Compose/DatabaseServerRegistrarAndMessengerComponent.cs
@@ -99,7 +99,7 @@ namespace Umbraco.Web.Compose
IServerMessenger serverMessenger,
IServerRegistrationService registrationService,
ILogger logger,
- IHostingEnvironmentLifetime hostingEnvironment,
+ IApplicationShutdownRegistry hostingEnvironment,
IRequestAccessor requestAccessor)
{
_runtime = runtime;
diff --git a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
index 89ec036607..139e9e9b67 100644
--- a/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
+++ b/src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs
@@ -28,21 +28,6 @@ namespace Umbraco.Core.Runtime
private readonly IGlobalSettings _globalSettings;
private readonly IConnectionStrings _connectionStrings;
-
- ///
- /// Constructor
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
public CoreRuntime(
Configs configs,
IUmbracoVersion umbracoVersion,
@@ -251,12 +236,12 @@ namespace Umbraco.Core.Runtime
// run handlers
RuntimeOptions.DoRuntimeEssentials(_factory);
- var hostingEnvironmentLifetime = _factory.TryGetInstance();
+ var hostingEnvironmentLifetime = _factory.TryGetInstance();
if (hostingEnvironmentLifetime == null)
- throw new InvalidOperationException($"An instance of {typeof(IHostingEnvironmentLifetime)} could not be resolved from the container, ensure that one if registered in your runtime before calling {nameof(IRuntime)}.{nameof(Start)}");
+ throw new InvalidOperationException($"An instance of {typeof(IApplicationShutdownRegistry)} could not be resolved from the container, ensure that one if registered in your runtime before calling {nameof(IRuntime)}.{nameof(Start)}");
// acquire the main domain - if this fails then anything that should be registered with MainDom will not operate
- AcquireMainDom(MainDom, _factory.GetInstance());
+ AcquireMainDom(MainDom, _factory.GetInstance());
// create & initialize the components
_components = _factory.GetInstance();
@@ -287,13 +272,13 @@ namespace Umbraco.Core.Runtime
IOHelper.SetRootDirectory(path);
}
- private bool AcquireMainDom(IMainDom mainDom, IHostingEnvironmentLifetime hostingEnvironmentLifetime)
+ private bool AcquireMainDom(IMainDom mainDom, IApplicationShutdownRegistry applicationShutdownRegistry)
{
using (var timer = ProfilingLogger.DebugDuration("Acquiring MainDom.", "Acquired."))
{
try
{
- return mainDom.Acquire(hostingEnvironmentLifetime);
+ return mainDom.Acquire(applicationShutdownRegistry);
}
catch
{
diff --git a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs
index 31884992f7..2cda289591 100644
--- a/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs
+++ b/src/Umbraco.Infrastructure/Scheduling/BackgroundTaskRunner.cs
@@ -81,7 +81,7 @@ namespace Umbraco.Web.Scheduling
private readonly string _logPrefix;
private readonly BackgroundTaskRunnerOptions _options;
private readonly ILogger _logger;
- private readonly IHostingEnvironmentLifetime _hostingEnvironment;
+ private readonly IApplicationShutdownRegistry _hostingEnvironment;
private readonly object _locker = new object();
private readonly BufferBlock _tasks = new BufferBlock(new DataflowBlockOptions());
@@ -105,7 +105,7 @@ namespace Umbraco.Web.Scheduling
/// A logger.
/// The hosting environment
/// An optional main domain hook.
- public BackgroundTaskRunner(ILogger logger, IHostingEnvironmentLifetime hostingEnvironment, MainDomHook hook = null)
+ public BackgroundTaskRunner(ILogger logger, IApplicationShutdownRegistry hostingEnvironment, MainDomHook hook = null)
: this(typeof(T).FullName, new BackgroundTaskRunnerOptions(), logger, hostingEnvironment, hook)
{ }
@@ -116,7 +116,7 @@ namespace Umbraco.Web.Scheduling
/// A logger.
/// The hosting environment
/// An optional main domain hook.
- public BackgroundTaskRunner(string name, ILogger logger, IHostingEnvironmentLifetime hostingEnvironment, MainDomHook hook = null)
+ public BackgroundTaskRunner(string name, ILogger logger, IApplicationShutdownRegistry hostingEnvironment, MainDomHook hook = null)
: this(name, new BackgroundTaskRunnerOptions(), logger, hostingEnvironment, hook)
{ }
@@ -127,7 +127,7 @@ namespace Umbraco.Web.Scheduling
/// A logger.
/// The hosting environment
/// An optional main domain hook.
- public BackgroundTaskRunner(BackgroundTaskRunnerOptions options, ILogger logger, IHostingEnvironmentLifetime hostingEnvironment, MainDomHook hook = null)
+ public BackgroundTaskRunner(BackgroundTaskRunnerOptions options, ILogger logger, IApplicationShutdownRegistry hostingEnvironment, MainDomHook hook = null)
: this(typeof(T).FullName, options, logger, hostingEnvironment, hook)
{ }
@@ -139,7 +139,7 @@ namespace Umbraco.Web.Scheduling
/// A logger.
/// The hosting environment
/// An optional main domain hook.
- public BackgroundTaskRunner(string name, BackgroundTaskRunnerOptions options, ILogger logger, IHostingEnvironmentLifetime hostingEnvironment, MainDomHook hook = null)
+ public BackgroundTaskRunner(string name, BackgroundTaskRunnerOptions options, ILogger logger, IApplicationShutdownRegistry hostingEnvironment, MainDomHook hook = null)
{
_options = options ?? throw new ArgumentNullException(nameof(options));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
diff --git a/src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs b/src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
index c867d81d69..30d0bc7e4a 100644
--- a/src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
+++ b/src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
@@ -31,7 +31,7 @@ namespace Umbraco.Web.Scheduling
private readonly IContentService _contentService;
private readonly IAuditService _auditService;
private readonly IProfilingLogger _logger;
- private readonly IHostingEnvironmentLifetime _hostingEnvironment;
+ private readonly IApplicationShutdownRegistry _hostingEnvironment;
private readonly IScopeProvider _scopeProvider;
private readonly HealthCheckCollection _healthChecks;
private readonly HealthCheckNotificationMethodCollection _notifications;
@@ -57,7 +57,7 @@ namespace Umbraco.Web.Scheduling
IContentService contentService, IAuditService auditService,
HealthCheckCollection healthChecks, HealthCheckNotificationMethodCollection notifications,
IScopeProvider scopeProvider, IUmbracoContextFactory umbracoContextFactory, IProfilingLogger logger,
- IHostingEnvironmentLifetime hostingEnvironment, IHealthChecksSettings healthChecksSettingsConfig,
+ IApplicationShutdownRegistry hostingEnvironment, IHealthChecksSettings healthChecksSettingsConfig,
IIOHelper ioHelper, IServerMessenger serverMessenger, IRequestAccessor requestAccessor,
ILoggingSettings loggingSettings, IKeepAliveSettings keepAliveSettings)
{
diff --git a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs
index fa697a4743..1946e2041b 100644
--- a/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs
+++ b/src/Umbraco.Infrastructure/Search/BackgroundIndexRebuilder.cs
@@ -18,10 +18,10 @@ namespace Umbraco.Web.Search
private readonly IndexRebuilder _indexRebuilder;
private readonly IMainDom _mainDom;
private readonly IProfilingLogger _logger;
- private readonly IHostingEnvironmentLifetime _hostingEnvironment;
+ private readonly IApplicationShutdownRegistry _hostingEnvironment;
private static BackgroundTaskRunner _rebuildOnStartupRunner;
- public BackgroundIndexRebuilder(IMainDom mainDom, IProfilingLogger logger, IHostingEnvironmentLifetime hostingEnvironment, IndexRebuilder indexRebuilder)
+ public BackgroundIndexRebuilder(IMainDom mainDom, IProfilingLogger logger, IApplicationShutdownRegistry hostingEnvironment, IndexRebuilder indexRebuilder)
{
_mainDom = mainDom;
_logger = logger;
diff --git a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
index 3c189cc045..3cfefa77ce 100644
--- a/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
+++ b/src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
@@ -42,7 +42,7 @@ namespace Umbraco.ModelsBuilder.Embedded
private static readonly string[] OurFiles = { "models.hash", "models.generated.cs", "all.generated.cs", "all.dll.path", "models.err" };
private readonly IModelsBuilderConfig _config;
- private readonly IHostingEnvironmentLifetime _hostingLifetime;
+ private readonly IApplicationShutdownRegistry _hostingLifetime;
private readonly IIOHelper _ioHelper;
private readonly ModelsGenerationError _errors;
@@ -51,7 +51,7 @@ namespace Umbraco.ModelsBuilder.Embedded
IProfilingLogger logger,
IModelsBuilderConfig config,
IHostingEnvironment hostingEnvironment,
- IHostingEnvironmentLifetime hostingLifetime,
+ IApplicationShutdownRegistry hostingLifetime,
IIOHelper ioHelper)
{
_umbracoServices = umbracoServices;
diff --git a/src/Umbraco.Tests.Common/TestHelperBase.cs b/src/Umbraco.Tests.Common/TestHelperBase.cs
index 22177c1a50..67108833c3 100644
--- a/src/Umbraco.Tests.Common/TestHelperBase.cs
+++ b/src/Umbraco.Tests.Common/TestHelperBase.cs
@@ -128,7 +128,7 @@ namespace Umbraco.Tests.Common
}
public abstract IHostingEnvironment GetHostingEnvironment();
- public abstract IHostingEnvironmentLifetime GetHostingEnvironmentLifetime();
+ public abstract IApplicationShutdownRegistry GetHostingEnvironmentLifetime();
public abstract IIpResolver GetIpResolver();
diff --git a/src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs b/src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
index 6be56a547b..60cac26349 100644
--- a/src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
+++ b/src/Umbraco.Tests.Integration/Implementations/HostBuilderExtensions.cs
@@ -5,6 +5,7 @@ using System.Data.SqlClient;
using System.IO;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
+using Umbraco.Core;
using Umbraco.Tests.Integration.Testing;
namespace Umbraco.Tests.Integration.Implementations
diff --git a/src/Umbraco.Tests.Integration/Implementations/TestHelper.cs b/src/Umbraco.Tests.Integration/Implementations/TestHelper.cs
index ccbf7b03d4..4a986fa35a 100644
--- a/src/Umbraco.Tests.Integration/Implementations/TestHelper.cs
+++ b/src/Umbraco.Tests.Integration/Implementations/TestHelper.cs
@@ -24,7 +24,7 @@ namespace Umbraco.Tests.Integration.Implementations
{
private IBackOfficeInfo _backOfficeInfo;
private readonly IHostingEnvironment _hostingEnvironment;
- private readonly IHostingEnvironmentLifetime _hostingLifetime;
+ private readonly IApplicationShutdownRegistry _hostingLifetime;
private readonly IIpResolver _ipResolver;
private readonly IWebHostEnvironment _hostEnvironment;
private readonly IHttpContextAccessor _httpContextAccessor;
@@ -46,7 +46,7 @@ namespace Umbraco.Tests.Integration.Implementations
_hostEnvironment,
_httpContextAccessor);
- _hostingLifetime = new AspNetCoreHostingEnvironmentLifetime(Mock.Of());
+ _hostingLifetime = new AspNetCoreApplicationShutdownRegistry(Mock.Of());
Logger = new ProfilingLogger(new ConsoleLogger(new MessageTemplates()), Profiler);
}
@@ -77,7 +77,7 @@ namespace Umbraco.Tests.Integration.Implementations
}
public override IHostingEnvironment GetHostingEnvironment() => _hostingEnvironment;
- public override IHostingEnvironmentLifetime GetHostingEnvironmentLifetime() => _hostingLifetime;
+ public override IApplicationShutdownRegistry GetHostingEnvironmentLifetime() => _hostingLifetime;
public override IIpResolver GetIpResolver() => _ipResolver;
diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs
index 5eb57b6ca6..bf7cbe40c4 100644
--- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs
+++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlPublishedSnapshotService.cs
@@ -41,7 +41,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
private readonly IEntityXmlSerializer _entitySerializer;
private readonly IVariationContextAccessor _variationContextAccessor;
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
- private readonly IHostingEnvironmentLifetime _hostingLifetime;
+ private readonly IApplicationShutdownRegistry _hostingLifetime;
private readonly IHostingEnvironment _hostingEnvironment;
#region Constructors
@@ -58,7 +58,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
ILogger logger,
IGlobalSettings globalSettings,
IHostingEnvironment hostingEnvironment,
- IHostingEnvironmentLifetime hostingLifetime,
+ IApplicationShutdownRegistry hostingLifetime,
IShortStringHelper shortStringHelper,
ISiteDomainHelper siteDomainHelper,
IEntityXmlSerializer entitySerializer,
@@ -86,7 +86,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
ILogger logger,
IGlobalSettings globalSettings,
IHostingEnvironment hostingEnvironment,
- IHostingEnvironmentLifetime hostingLifetime,
+ IApplicationShutdownRegistry hostingLifetime,
IShortStringHelper shortStringHelper,
ISiteDomainHelper siteDomainHelper,
IEntityXmlSerializer entitySerializer,
diff --git a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
index b051682ed7..dadf8b6824 100644
--- a/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
+++ b/src/Umbraco.Tests/LegacyXmlPublishedCache/XmlStore.cs
@@ -46,7 +46,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
private readonly IMediaRepository _mediaRepository;
private readonly IMemberRepository _memberRepository;
private readonly IEntityXmlSerializer _entitySerializer;
- private readonly IHostingEnvironmentLifetime _hostingLifetime;
+ private readonly IApplicationShutdownRegistry _hostingLifetime;
private readonly IShortStringHelper _shortStringHelper;
private readonly IPublishedSnapshotAccessor _publishedSnapshotAccessor;
private readonly PublishedContentTypeCache _contentTypeCache;
@@ -65,7 +65,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
///
/// The default constructor will boot the cache, load data from file or database, /// wire events in order to manage changes, etc.
public XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
- IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IHostingEnvironmentLifetime hostingLifetime, IShortStringHelper shortStringHelper)
+ IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IApplicationShutdownRegistry hostingLifetime, IShortStringHelper shortStringHelper)
: this(contentTypeService, contentService, scopeProvider, routesCache, contentTypeCache, publishedSnapshotAccessor, mainDom, false, false, documentRepository, mediaRepository, memberRepository, entitySerializer, hostingEnvironment, hostingLifetime, shortStringHelper)
{ }
@@ -74,7 +74,7 @@ namespace Umbraco.Tests.LegacyXmlPublishedCache
// TODO: er, we DO have a DB?
internal XmlStore(IContentTypeService contentTypeService, IContentService contentService, IScopeProvider scopeProvider, RoutesCache routesCache, PublishedContentTypeCache contentTypeCache,
IPublishedSnapshotAccessor publishedSnapshotAccessor, MainDom mainDom,
- bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IHostingEnvironmentLifetime hostingLifetime, IShortStringHelper shortStringHelper)
+ bool testing, bool enableRepositoryEvents, IDocumentRepository documentRepository, IMediaRepository mediaRepository, IMemberRepository memberRepository, IEntityXmlSerializer entitySerializer, IHostingEnvironment hostingEnvironment, IApplicationShutdownRegistry hostingLifetime, IShortStringHelper shortStringHelper)
{
if (testing == false)
EnsureConfigurationIsValid();
diff --git a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
index 8443de7b09..6ccb2c3b35 100644
--- a/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
+++ b/src/Umbraco.Tests/Runtimes/CoreRuntimeTests.cs
@@ -133,7 +133,7 @@ namespace Umbraco.Tests.Runtimes
public override IFactory Configure(IRegister container)
{
- container.Register(Lifetime.Singleton);
+ container.Register(Lifetime.Singleton);
var factory = base.Configure(container);
return factory;
diff --git a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs
index 18eb3d19a4..2291584f66 100644
--- a/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs
+++ b/src/Umbraco.Tests/Scheduling/BackgroundTaskRunnerTests.cs
@@ -19,7 +19,7 @@ namespace Umbraco.Tests.Scheduling
public class BackgroundTaskRunnerTests
{
private ILogger _logger;
- private IHostingEnvironmentLifetime _hostingEnvironment;
+ private IApplicationShutdownRegistry _hostingEnvironment;
[OneTimeSetUp]
public void InitializeFixture()
diff --git a/src/Umbraco.Tests/TestHelpers/TestHelper.cs b/src/Umbraco.Tests/TestHelpers/TestHelper.cs
index 9cc9059499..11393e3e6b 100644
--- a/src/Umbraco.Tests/TestHelpers/TestHelper.cs
+++ b/src/Umbraco.Tests/TestHelpers/TestHelper.cs
@@ -62,8 +62,8 @@ namespace Umbraco.Tests.TestHelpers
public override IHostingEnvironment GetHostingEnvironment()
=> new AspNetHostingEnvironment(SettingsForTests.GetDefaultHostingSettings());
- public override IHostingEnvironmentLifetime GetHostingEnvironmentLifetime()
- => new AspNetHostingLifetime();
+ public override IApplicationShutdownRegistry GetHostingEnvironmentLifetime()
+ => new AspNetApplicationShutdownRegistry();
public override IIpResolver GetIpResolver()
=> new AspNetIpResolver();
@@ -323,7 +323,7 @@ namespace Umbraco.Tests.TestHelpers
public static IHostingEnvironment GetHostingEnvironment() => _testHelperInternal.GetHostingEnvironment();
- public static IHostingEnvironmentLifetime GetHostingEnvironmentLifetime() => _testHelperInternal.GetHostingEnvironmentLifetime();
+ public static IApplicationShutdownRegistry GetHostingEnvironmentLifetime() => _testHelperInternal.GetHostingEnvironmentLifetime();
public static IIpResolver GetIpResolver() => _testHelperInternal.GetIpResolver();
diff --git a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs
index 96576ac9a4..0345aab2da 100644
--- a/src/Umbraco.Tests/Testing/UmbracoTestBase.cs
+++ b/src/Umbraco.Tests/Testing/UmbracoTestBase.cs
@@ -140,7 +140,7 @@ namespace Umbraco.Tests.Testing
protected virtual IProfilingLogger ProfilingLogger => Factory.GetInstance();
protected IHostingEnvironment HostingEnvironment { get; } = new AspNetHostingEnvironment(TestHelpers.SettingsForTests.GetDefaultHostingSettings());
- protected IHostingEnvironmentLifetime HostingLifetime { get; } = new AspNetHostingLifetime();
+ protected IApplicationShutdownRegistry HostingLifetime { get; } = new AspNetApplicationShutdownRegistry();
protected IIpResolver IpResolver => Factory.GetInstance();
protected IBackOfficeInfo BackOfficeInfo => Factory.GetInstance();
protected AppCaches AppCaches => Factory.GetInstance();
diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreHostingEnvironmentShutdown.cs b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreApplicationShutdownRegistry.cs
similarity index 90%
rename from src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreHostingEnvironmentShutdown.cs
rename to src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreApplicationShutdownRegistry.cs
index 3726e50e3b..92af822836 100644
--- a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreHostingEnvironmentShutdown.cs
+++ b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreApplicationShutdownRegistry.cs
@@ -7,13 +7,13 @@ using Umbraco.Core.Hosting;
namespace Umbraco.Web.BackOffice.AspNetCore
{
- public class AspNetCoreHostingEnvironmentLifetime : IHostingEnvironmentLifetime
+ public class AspNetCoreApplicationShutdownRegistry : IApplicationShutdownRegistry
{
private readonly IHostApplicationLifetime _hostApplicationLifetime;
private readonly ConcurrentDictionary _registeredObjects =
new ConcurrentDictionary();
- public AspNetCoreHostingEnvironmentLifetime(IHostApplicationLifetime hostApplicationLifetime)
+ public AspNetCoreApplicationShutdownRegistry(IHostApplicationLifetime hostApplicationLifetime)
{
_hostApplicationLifetime = hostApplicationLifetime;
}
diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
index 3c65c24b1f..fc38e429a0 100644
--- a/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
+++ b/src/Umbraco.Web.BackOffice/AspNetCore/AspNetCoreComposer.cs
@@ -21,7 +21,7 @@ namespace Umbraco.Web.BackOffice.AspNetCore
// Our own netcore implementations
composition.RegisterUnique();
- composition.RegisterUnique();
+ composition.RegisterUnique();
}
}
}
diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs
index feb122a48b..770f4b883f 100644
--- a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs
+++ b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs
@@ -27,7 +27,7 @@ namespace Umbraco.Web.BackOffice.AspNetCore
if (app == null) throw new ArgumentNullException(nameof(app));
// Register a listener for application shutdown in order to terminate the runtime
- var hostLifetime = app.ApplicationServices.GetRequiredService();
+ var hostLifetime = app.ApplicationServices.GetRequiredService();
var runtime = app.ApplicationServices.GetRequiredService();
var runtimeShutdown = new CoreRuntimeShutdown(runtime, hostLifetime);
hostLifetime.RegisterObject(runtimeShutdown);
@@ -43,7 +43,7 @@ namespace Umbraco.Web.BackOffice.AspNetCore
///
private class CoreRuntimeShutdown : IRegisteredObject
{
- public CoreRuntimeShutdown(IRuntime runtime, IHostingEnvironmentLifetime hostLifetime)
+ public CoreRuntimeShutdown(IRuntime runtime, IApplicationShutdownRegistry hostLifetime)
{
_runtime = runtime;
_hostLifetime = hostLifetime;
@@ -51,7 +51,7 @@ namespace Umbraco.Web.BackOffice.AspNetCore
private bool _completed = false;
private readonly IRuntime _runtime;
- private readonly IHostingEnvironmentLifetime _hostLifetime;
+ private readonly IApplicationShutdownRegistry _hostLifetime;
public void Stop(bool immediate)
{
diff --git a/src/Umbraco.Web/AspNet/AspNetHostingLifetime.cs b/src/Umbraco.Web/AspNet/AspNetApplicationShutdownRegistry.cs
similarity index 94%
rename from src/Umbraco.Web/AspNet/AspNetHostingLifetime.cs
rename to src/Umbraco.Web/AspNet/AspNetApplicationShutdownRegistry.cs
index 316ecb8389..dbd6e9e834 100644
--- a/src/Umbraco.Web/AspNet/AspNetHostingLifetime.cs
+++ b/src/Umbraco.Web/AspNet/AspNetApplicationShutdownRegistry.cs
@@ -6,7 +6,7 @@ using IRegisteredObject = Umbraco.Core.IRegisteredObject;
namespace Umbraco.Web.Hosting
{
- public class AspNetHostingLifetime : IHostingEnvironmentLifetime
+ public class AspNetApplicationShutdownRegistry : IApplicationShutdownRegistry
{
private readonly ConcurrentDictionary _registeredObjects =
new ConcurrentDictionary();
diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj
index ce08d5498d..4b4f06ad2a 100755
--- a/src/Umbraco.Web/Umbraco.Web.csproj
+++ b/src/Umbraco.Web/Umbraco.Web.csproj
@@ -134,7 +134,7 @@
-
+