@Order(value=-2147483627) public class BackgroundPreinitializer extends Object implements org.springframework.context.ApplicationListener<SpringApplicationEvent>
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.
Modifier and Type | Field and Description |
---|---|
static String |
IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME
System property that instructs Spring Boot how to run pre initialization.
|
Constructor and Description |
---|
BackgroundPreinitializer() |
Modifier and Type | Method and Description |
---|---|
void |
onApplicationEvent(SpringApplicationEvent event) |
public static final String IGNORE_BACKGROUNDPREINITIALIZER_PROPERTY_NAME
true
, no pre-initialization happens and each item is
initialized in the foreground as it needs to. When the property is false
(default), pre initialization runs in a separate thread in the background.public void onApplicationEvent(SpringApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<SpringApplicationEvent>
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.