mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Add background preinitializers for Tomcat and JDK ZoneId
Closes gh-37670
This commit is contained in:
parent
fd9b2b114e
commit
560527945b
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user