Class BackgroundPreinitializer
- java.lang.Object
- org.springframework.boot.autoconfigure.BackgroundPreinitializer
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>
@Order(-2147483627) public class BackgroundPreinitializer extends Object implements org.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>
ApplicationListenerto trigger early initialization in a background thread of time consuming tasks.Set the
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAMEsystem property totrueto disable this mechanism and let such initialization happen in the foreground.- Since:
- 1.3.0
Field Summary
Fields Modifier and Type Field Description static StringIGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAMESystem property that instructs Spring Boot how to run pre initialization.
Constructor Summary
Constructors Constructor Description BackgroundPreinitializer()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonApplicationEvent(org.springframework.boot.context.event.SpringApplicationEvent event)
Field Detail
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME
public static final String IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME
System property that instructs Spring Boot how to run pre initialization. When the property is set totrue, no pre-initialization happens and each item is initialized in the foreground as it needs to. When the property isfalse(default), pre initialization runs in a separate thread in the background.- Since:
- 2.1.0
- See Also:
- Constant Field Values
Constructor Detail
BackgroundPreinitializer
public BackgroundPreinitializer()
Method Detail
onApplicationEvent
public void onApplicationEvent(org.springframework.boot.context.event.SpringApplicationEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.boot.context.event.SpringApplicationEvent>