mirror of
https://github.com/spring-projects/spring-boot.git
synced 2026-05-04 05:01:06 +01:00
Add background preinitializers for Tomcat and JDK ZoneId
Closes gh-37670
This commit is contained in:
+24
@@ -17,11 +17,14 @@
|
||||
package org.springframework.boot.autoconfigure;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.ZoneId;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import jakarta.validation.Configuration;
|
||||
import jakarta.validation.Validation;
|
||||
import org.apache.catalina.authenticator.NonLoginAuthenticator;
|
||||
import org.apache.tomcat.util.http.Rfc6265CookieProcessor;
|
||||
|
||||
import org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent;
|
||||
import org.springframework.boot.context.event.ApplicationFailedEvent;
|
||||
@@ -107,6 +110,8 @@ public class BackgroundPreinitializer implements ApplicationListener<SpringAppli
|
||||
runSafely(new JacksonInitializer());
|
||||
}
|
||||
runSafely(new CharsetInitializer());
|
||||
runSafely(new TomcatInitializer());
|
||||
runSafely(new JdkInitializer());
|
||||
preinitializationComplete.countDown();
|
||||
}
|
||||
|
||||
@@ -189,4 +194,23 @@ public class BackgroundPreinitializer implements ApplicationListener<SpringAppli
|
||||
|
||||
}
|
||||
|
||||
private static class TomcatInitializer implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
new Rfc6265CookieProcessor();
|
||||
new NonLoginAuthenticator();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static class JdkInitializer implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
ZoneId.systemDefault();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user