From 172f4b957ac482cc408efd9af49d9ee3907ce941 Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Mon, 25 Jul 2016 13:37:02 -0500 Subject: [PATCH] Added code to record task completion when process is terminated gracefully Updated per code review Updates for merge --- .../task/listener/TaskLifecycleListener.java | 18 ++++++++++++++---- .../src/main/asciidoc/features.adoc | 3 +++ 2 files changed, 17 insertions(+), 4 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 5aaecabb..42c2694a 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 @@ -27,6 +27,7 @@ import java.util.List; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationArguments; @@ -62,7 +63,7 @@ import org.springframework.util.Assert; * * @author Michael Minella */ -public class TaskLifecycleListener implements ApplicationListener, SmartLifecycle { +public class TaskLifecycleListener implements ApplicationListener, SmartLifecycle, DisposableBean { @Autowired private ConfigurableApplicationContext context; @@ -78,6 +79,8 @@ public class TaskLifecycleListener implements ApplicationListener