maven cleanup

This commit is contained in:
eugenp
2015-08-23 21:07:48 +03:00
parent ebcf6c8b74
commit 6ef3de5c3d
2 changed files with 7 additions and 16 deletions
@@ -2,12 +2,15 @@ package org.baeldung.spring.config;
import java.util.concurrent.ExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public final class CleanupBean implements DisposableBean {
private final Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ExecutorService setupExecutor;
@@ -20,7 +23,11 @@ public final class CleanupBean implements DisposableBean {
@Override
public void destroy() {
logger.info("Starting shutdown process - cleanup");
setupExecutor.shutdownNow();
logger.info("Finishing shutdown process - cleanup");
}
}