diff --git a/spring-all/pom.xml b/spring-all/pom.xml
index 3391846d97..25db828613 100644
--- a/spring-all/pom.xml
+++ b/spring-all/pom.xml
@@ -7,6 +7,12 @@
spring-all
war
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.2.5.RELEASE
+
+
@@ -101,6 +107,27 @@
guava
${guava.version}
+
+
+
+
+ org.slf4j
+ slf4j-api
+
+
+ ch.qos.logback
+ logback-classic
+
+
+
+ org.slf4j
+ jcl-over-slf4j
+
+
+
+ org.slf4j
+ log4j-over-slf4j
+
diff --git a/spring-all/src/main/java/org/baeldung/spring/config/CleanupBean.java b/spring-all/src/main/java/org/baeldung/spring/config/CleanupBean.java
new file mode 100644
index 0000000000..34e01bf15b
--- /dev/null
+++ b/spring-all/src/main/java/org/baeldung/spring/config/CleanupBean.java
@@ -0,0 +1,26 @@
+package org.baeldung.spring.config;
+
+import java.util.concurrent.ExecutorService;
+
+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 {
+
+ @Autowired
+ private ExecutorService setupExecutor;
+
+ public CleanupBean() {
+ super();
+ }
+
+ //
+
+ @Override
+ public void destroy() {
+ setupExecutor.shutdownNow();
+ }
+
+}
\ No newline at end of file
diff --git a/spring-all/src/main/java/org/baeldung/spring/config/CoreConfig.java b/spring-all/src/main/java/org/baeldung/spring/config/CoreConfig.java
index ff1742351b..21b67933ef 100644
--- a/spring-all/src/main/java/org/baeldung/spring/config/CoreConfig.java
+++ b/spring-all/src/main/java/org/baeldung/spring/config/CoreConfig.java
@@ -1,5 +1,11 @@
package org.baeldung.spring.config;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.LinkedBlockingQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
@@ -12,4 +18,15 @@ public class CoreConfig extends WebMvcConfigurerAdapter {
super();
}
+ // beans
+
+ @Bean
+ public ExecutorService setupExecutor() {
+ final int coreThreads = 4;
+ final int maxThreads = 8;
+ final ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(coreThreads, maxThreads, 60L, TimeUnit.SECONDS, new LinkedBlockingQueue());
+ threadPoolExecutor.allowCoreThreadTimeOut(true);
+ return threadPoolExecutor;
+ }
+
}
\ No newline at end of file
diff --git a/spring-security-rest-full/pom.xml b/spring-security-rest-full/pom.xml
index daa0ed01af..7a219288de 100644
--- a/spring-security-rest-full/pom.xml
+++ b/spring-security-rest-full/pom.xml
@@ -7,6 +7,12 @@
spring-security-rest-full
war
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 1.2.5.RELEASE
+
+
@@ -454,10 +460,4 @@
-
- org.springframework.boot
- spring-boot-starter-parent
- 1.2.4.RELEASE
-
-
\ No newline at end of file