|
|
|
@ -46,7 +46,8 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage
|
|
|
|
|
public class BackgroundPreinitializer
|
|
|
|
|
implements ApplicationListener<SpringApplicationEvent> {
|
|
|
|
|
|
|
|
|
|
private static final AtomicBoolean preinitializationStarted = new AtomicBoolean(false);
|
|
|
|
|
private static final AtomicBoolean preinitializationStarted = new AtomicBoolean(
|
|
|
|
|
false);
|
|
|
|
|
|
|
|
|
|
private static final CountDownLatch preinitializationComplete = new CountDownLatch(1);
|
|
|
|
|
|
|
|
|
@ -57,8 +58,9 @@ public class BackgroundPreinitializer
|
|
|
|
|
performPreinitialization();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (event instanceof ApplicationReadyEvent
|
|
|
|
|
|| event instanceof ApplicationFailedEvent) {
|
|
|
|
|
if ((event instanceof ApplicationReadyEvent
|
|
|
|
|
|| event instanceof ApplicationFailedEvent)
|
|
|
|
|
&& preinitializationStarted.get()) {
|
|
|
|
|
try {
|
|
|
|
|
preinitializationComplete.await();
|
|
|
|
|
}
|
|
|
|
|