Class BackgroundPreinitializer
java.lang.Object
org.springframework.boot.autoconfigure.BackgroundPreinitializer
- All Implemented Interfaces:
- EventListener,- ApplicationListener<SpringApplicationEvent>,- Ordered
public class BackgroundPreinitializer
extends Object
implements ApplicationListener<SpringApplicationEvent>, Ordered
ApplicationListener to trigger early initialization in a background thread of
 time-consuming tasks.
 
 Set the IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME system property to
 true to disable this mechanism and let such initialization happen in the
 foreground.
- Since:
- 1.3.0
- Author:
- Phillip Webb, Andy Wilkinson, Artsiom Yudovin, Sebastien Deleuze
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringSystem property that instructs Spring Boot how to run pre initialization.Fields inherited from interface org.springframework.core.OrderedHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Field Details- 
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAMESystem 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:
 
 
- 
- 
Constructor Details- 
BackgroundPreinitializerpublic BackgroundPreinitializer()
 
- 
- 
Method Details- 
getOrderpublic int getOrder()
- 
onApplicationEvent- Specified by:
- onApplicationEventin interface- ApplicationListener<SpringApplicationEvent>
 
 
-