From 6aaa3cbe0698e31196692bb6244fd6fac4f53534 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 14 Oct 2015 01:09:11 -0700 Subject: [PATCH] Use IApplicationLifetime.StopApplication instead of IApplicationShutdown. React to hosting changes https://github.com/aspnet/Hosting/commit/374526b2704f6a6b1dbb6587b704efd29109ab30 --- .../Infrastructure/KestrelThread.cs | 2 +- ...wnNotImplemented.cs => LifetimeNotImplemented.cs} | 12 ++---------- .../TestServiceContext.cs | 2 +- 3 files changed, 4 insertions(+), 12 deletions(-) rename test/Microsoft.AspNet.Server.KestrelTests/{ShutdownNotImplemented.cs => LifetimeNotImplemented.cs} (76%) diff --git a/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/KestrelThread.cs b/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/KestrelThread.cs index b989f2762b..69281fddae 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/KestrelThread.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Infrastructure/KestrelThread.cs @@ -232,7 +232,7 @@ namespace Microsoft.AspNet.Server.Kestrel _closeError = ExceptionDispatchInfo.Capture(ex); // Request shutdown so we can rethrow this exception // in Stop which should be observable. - _appLifetime.RequestShutdown(); + _appLifetime.StopApplication(); } } diff --git a/test/Microsoft.AspNet.Server.KestrelTests/ShutdownNotImplemented.cs b/test/Microsoft.AspNet.Server.KestrelTests/LifetimeNotImplemented.cs similarity index 76% rename from test/Microsoft.AspNet.Server.KestrelTests/ShutdownNotImplemented.cs rename to test/Microsoft.AspNet.Server.KestrelTests/LifetimeNotImplemented.cs index 4e7b084e93..e014424b41 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/ShutdownNotImplemented.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/LifetimeNotImplemented.cs @@ -7,7 +7,7 @@ using Microsoft.AspNet.Hosting; namespace Microsoft.AspNet.Server.KestrelTests { - public class ShutdownNotImplemented : IApplicationLifetime + public class LifetimeNotImplemented : IApplicationLifetime { public CancellationToken ApplicationStarted { @@ -33,15 +33,7 @@ namespace Microsoft.AspNet.Server.KestrelTests } } - public CancellationToken ShutdownRequested - { - get - { - throw new NotImplementedException(); - } - } - - public void RequestShutdown() + public void StopApplication() { throw new NotImplementedException(); } diff --git a/test/Microsoft.AspNet.Server.KestrelTests/TestServiceContext.cs b/test/Microsoft.AspNet.Server.KestrelTests/TestServiceContext.cs index 64f2018fdb..edbeb9c44b 100644 --- a/test/Microsoft.AspNet.Server.KestrelTests/TestServiceContext.cs +++ b/test/Microsoft.AspNet.Server.KestrelTests/TestServiceContext.cs @@ -6,7 +6,7 @@ namespace Microsoft.AspNet.Server.KestrelTests { public TestServiceContext() { - AppLifetime = new ShutdownNotImplemented(); + AppLifetime = new LifetimeNotImplemented(); Log = new TestKestrelTrace(); DateHeaderValueManager = new TestDateHeaderValueManager(); }