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