|
|
|
@ -62,6 +62,8 @@ class AbstractContextLoader<T extends ConfigurableApplicationContext, L extends
|
|
|
|
|
|
|
|
|
|
private ClassLoader classLoader;
|
|
|
|
|
|
|
|
|
|
private ApplicationContext parent;
|
|
|
|
|
|
|
|
|
|
protected AbstractContextLoader(Supplier<T> contextSupplier) {
|
|
|
|
|
this.contextSupplier = contextSupplier;
|
|
|
|
|
}
|
|
|
|
@ -115,6 +117,12 @@ class AbstractContextLoader<T extends ConfigurableApplicationContext, L extends
|
|
|
|
|
return self();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public L parent(ApplicationContext parent) {
|
|
|
|
|
this.parent = parent;
|
|
|
|
|
return self();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Add the specified auto-configuration classes.
|
|
|
|
|
* @param autoConfigurations the auto-configuration classes to add
|
|
|
|
@ -226,6 +234,9 @@ class AbstractContextLoader<T extends ConfigurableApplicationContext, L extends
|
|
|
|
|
|
|
|
|
|
private T configureApplicationContext() {
|
|
|
|
|
T context = AbstractContextLoader.this.contextSupplier.get();
|
|
|
|
|
if (this.parent != null) {
|
|
|
|
|
context.setParent(this.parent);
|
|
|
|
|
}
|
|
|
|
|
if (this.classLoader != null) {
|
|
|
|
|
Assert.isInstanceOf(DefaultResourceLoader.class, context);
|
|
|
|
|
((DefaultResourceLoader) context).setClassLoader(this.classLoader);
|
|
|
|
|