diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java index 7bd1dbf4ef..c96ea89930 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/WebServerGracefulShutdownLifecycle.java @@ -31,7 +31,7 @@ public final class WebServerGracefulShutdownLifecycle implements SmartLifecycle * {@link SmartLifecycle#getPhase() SmartLifecycle phase} in which graceful shutdown * of the web server is performed. */ - public static final int SMART_LIFECYCLE_PHASE = SmartLifecycle.DEFAULT_PHASE; + public static final int SMART_LIFECYCLE_PHASE = SmartLifecycle.DEFAULT_PHASE - 1024; private final WebServer webServer; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java index ebd2b7b72f..d50172824a 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/WebServerStartStopLifecycle.java @@ -16,6 +16,7 @@ package org.springframework.boot.web.reactive.context; +import org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle; import org.springframework.boot.web.server.WebServer; import org.springframework.context.SmartLifecycle; @@ -54,7 +55,7 @@ class WebServerStartStopLifecycle implements SmartLifecycle { @Override public int getPhase() { - return Integer.MAX_VALUE - 1; + return WebServerGracefulShutdownLifecycle.SMART_LIFECYCLE_PHASE - 1024; } } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java index c5c07627be..a8e44ef50e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/WebServerStartStopLifecycle.java @@ -16,6 +16,7 @@ package org.springframework.boot.web.servlet.context; +import org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle; import org.springframework.boot.web.server.WebServer; import org.springframework.context.SmartLifecycle; @@ -59,7 +60,7 @@ class WebServerStartStopLifecycle implements SmartLifecycle { @Override public int getPhase() { - return Integer.MAX_VALUE - 1; + return WebServerGracefulShutdownLifecycle.SMART_LIFECYCLE_PHASE - 1024; } }