diff --git a/src/Umbraco.Core/ApplicationEventHandler.cs b/src/Umbraco.Core/ApplicationEventHandler.cs index f6e17b4383..c84826cdff 100644 --- a/src/Umbraco.Core/ApplicationEventHandler.cs +++ b/src/Umbraco.Core/ApplicationEventHandler.cs @@ -10,7 +10,7 @@ namespace Umbraco.Core /// if you need these methods to execute even if either of these are not configured you can override the properties: /// ExecuteWhenApplicationNotConfigured and ExecuteWhenDatabaseNotConfigured /// - public class ApplicationEventHandler : IApplicationEventHandler + public abstract class ApplicationEventHandler : IApplicationEventHandler { public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { diff --git a/src/Umbraco.Web/CacheHelperExtensions.cs b/src/Umbraco.Web/CacheHelperExtensions.cs index 9ecc14e785..1c22d9557b 100644 --- a/src/Umbraco.Web/CacheHelperExtensions.cs +++ b/src/Umbraco.Web/CacheHelperExtensions.cs @@ -22,9 +22,9 @@ namespace Umbraco.Web /// /// This would be better left internal, however /// - public sealed class CacheHelperApplicationEventListener : IApplicationEventHandler + public sealed class CacheHelperApplicationEventListener : ApplicationEventHandler { - public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) + protected override void ApplicationInitialized(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { if (applicationContext != null) { @@ -44,13 +44,6 @@ namespace Umbraco.Web } } - public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - } - - public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) - { - } } public const string PartialViewCacheKey = "Umbraco.Web.PartialViewCacheKey"; diff --git a/src/Umbraco.Web/LegacyScheduledTasks.cs b/src/Umbraco.Web/LegacyScheduledTasks.cs index f79b383b06..ca819e02ed 100644 --- a/src/Umbraco.Web/LegacyScheduledTasks.cs +++ b/src/Umbraco.Web/LegacyScheduledTasks.cs @@ -16,18 +16,13 @@ namespace Umbraco.Web // and it needs to be manually registered - which we want to avoid, in order // to be as unobtrusive as possible - internal sealed class LegacyScheduledTasks : IApplicationEventHandler + internal sealed class LegacyScheduledTasks : ApplicationEventHandler { Timer _pingTimer; Timer _publishingTimer; CacheItemRemovedCallback _onCacheRemove; - public void OnApplicationInitialized(UmbracoApplicationBase umbracoApplication, Core.ApplicationContext applicationContext) - { - // nothing yet - } - - public void OnApplicationStarting(UmbracoApplicationBase umbracoApplication, Core.ApplicationContext applicationContext) + protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, Core.ApplicationContext applicationContext) { if (umbracoApplication.Context == null) return; @@ -48,11 +43,6 @@ namespace Umbraco.Web AddTask(LOG_SCRUBBER_TASK_NAME, GetLogScrubbingInterval()); } - public void OnApplicationStarted(UmbracoApplicationBase httpApplication, Core.ApplicationContext applicationContext) - { - // nothing - } - #region Log Scrubbing // this is a raw copy of the legacy code in all its uglyness diff --git a/src/Umbraco.Web/Search/ExamineEvents.cs b/src/Umbraco.Web/Search/ExamineEvents.cs index fa35570f60..a00be7d56f 100644 --- a/src/Umbraco.Web/Search/ExamineEvents.cs +++ b/src/Umbraco.Web/Search/ExamineEvents.cs @@ -24,7 +24,7 @@ namespace Umbraco.Web.Search /// /// Used to wire up events for Examine /// - public class ExamineEvents : ApplicationEventHandler + public sealed class ExamineEvents : ApplicationEventHandler { ///