diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index 0b8bbab11a..b9c5462ca8 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -20,11 +20,9 @@ import javax.validation.Validation; import org.apache.catalina.mbeans.MBeanFactory; -import org.springframework.boot.context.event.ApplicationStartedEvent; +import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent; import org.springframework.boot.logging.LoggingApplicationListener; -import org.springframework.context.ApplicationEvent; import org.springframework.context.ApplicationListener; -import org.springframework.context.event.ContextRefreshedEvent; import org.springframework.core.annotation.Order; import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; @@ -37,21 +35,11 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage * @since 1.3.0 */ @Order(LoggingApplicationListener.DEFAULT_ORDER + 1) -public class BackgroundPreinitializer implements ApplicationListener { - - private volatile Thread initializationThread; +public class BackgroundPreinitializer + implements ApplicationListener { @Override - public void onApplicationEvent(ApplicationEvent event) { - if (event instanceof ApplicationStartedEvent) { - performInitialization(); - } - else if (event instanceof ContextRefreshedEvent) { - awaitInitialization(); - } - } - - private void performInitialization() { + public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { try { Thread thread = new Thread(new Runnable() { @@ -73,7 +61,6 @@ public class BackgroundPreinitializer implements ApplicationListener2.7.7 1.9.32 1.1.0 - 1.8.8 + 1.8.9 2.3.0 3.9.3 2.1.4 @@ -80,13 +80,13 @@ 3.6 4.3.11.Final 5.2.4.Final - 2.4.3 + 2.4.5 2.3.13 2.4.7.Final 2.3.3 2.19 4.1.1 - 4.5.1 + 4.5.2 4.4.4 8.1.2.Final 2.7.2 @@ -96,7 +96,7 @@ 1.5.5 1.2 1.1.6 - 2.2.9 + 2.2.10 3.3.0.Final 2.0.6 2.8.1 @@ -107,7 +107,7 @@ 4.2.2 2.9.2 1.3.3 - 3.7.2 + 3.7.3 20140107 1.3.0 2.1.0 @@ -116,7 +116,7 @@ 4.12 3.4.2 2.5 - 1.1.6 + 1.1.7 1.16.8 1.3.6 1.10.19 @@ -131,13 +131,13 @@ 2.2.2 3.1.0 1.1.1 - 1.7.20 + 1.7.21 1.17 5.5.0 1.0-groovy-2.4 4.3.0.BUILD-SNAPSHOT 1.6.0.M2 - 1.2.1.RELEASE + 1.2.2.RELEASE 3.0.6.RELEASE Hopper-RC1 0.19.0.RELEASE @@ -147,8 +147,8 @@ 1.2.0.RELEASE 1.1.0.M1 1.1.2.RELEASE - 4.0.3.RELEASE - 1.0.3.RELEASE + 4.0.4.RELEASE + 1.0.4.RELEASE 2.0.9.RELEASE 1.1.0.RELEASE 1.1.0.RELEASE @@ -166,8 +166,8 @@ 1.3.3 1.3 2.1.0.RELEASE - 8.0.32 - 1.3.19.Final + 8.0.33 + 1.3.20.Final 1.7 2.0 9f96c74