From e60c29d41d574c226401a1f87fc3a31a7ff4cc02 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Fri, 14 Jun 2019 14:19:39 -0400 Subject: [PATCH] Updated the order in which the TaskLifecycleListener is configured resolves #605 --- .../cloud/task/listener/TaskLifecycleListener.java | 10 ++++++++-- spring-cloud-task-docs/src/main/asciidoc/features.adoc | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/TaskLifecycleListener.java b/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/TaskLifecycleListener.java index 01ffef74..0c4a33e9 100644 --- a/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/TaskLifecycleListener.java +++ b/spring-cloud-task-core/src/main/java/org/springframework/cloud/task/listener/TaskLifecycleListener.java @@ -45,7 +45,7 @@ import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.SmartLifecycle; -import org.springframework.context.event.ContextRefreshedEvent; +import org.springframework.core.Ordered; import org.springframework.util.Assert; import org.springframework.util.StringUtils; @@ -70,7 +70,8 @@ import org.springframework.util.StringUtils; * @author Michael Minella * @author Glenn Renfro */ -public class TaskLifecycleListener implements ApplicationListener, SmartLifecycle, DisposableBean { +public class TaskLifecycleListener implements ApplicationListener, + SmartLifecycle, DisposableBean, Ordered { @Autowired private ConfigurableApplicationContext context; @@ -394,4 +395,9 @@ public class TaskLifecycleListener implements ApplicationListener