Ensure there is a single bootstrap parent context
Only one neds to be created, and once it is in place in the hierarchy it should be usable by all the child contexts that get added. Fixes gh-153
This commit is contained in:
@@ -81,6 +81,11 @@ public class BootstrapApplicationListener
|
||||
if (environment.getPropertySources().contains(BOOTSTRAP_PROPERTY_SOURCE_NAME)) {
|
||||
return;
|
||||
}
|
||||
for (ApplicationContextInitializer<?> initializer : event.getSpringApplication().getInitializers()) {
|
||||
if (initializer instanceof ParentContextApplicationContextInitializer) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
ConfigurableApplicationContext context = bootstrapServiceContext(environment,
|
||||
event.getSpringApplication());
|
||||
apply(context, event.getSpringApplication(), environment);
|
||||
|
||||
Reference in New Issue
Block a user