maven cleanup
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user