From ffe21175ca720e40f33d9e02681b2d339dad17f3 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 5 Apr 2016 12:17:49 +0100 Subject: [PATCH] Upgrade to Logback 1.1.7 Closes gh-5568 --- .../BackgroundPreinitializer.java | 37 +++---------------- spring-boot-dependencies/pom.xml | 2 +- 2 files changed, 6 insertions(+), 33 deletions(-) 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 0b8bbab11a1..b9c5462ca8f 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 ApplicationListener3.4.2 1.2.17 2.4.1 - 1.1.6 + 1.1.7 1.2.3 1.10.19 2.13.3