Allow AggregateApplicationBuilder with no arg constructor
- When the AggregateApplicationBuilder doesn't have constructor args set, then invoke parent configuration setup with no args. - This will make sure to set the parent context for the child application contexts This resolves #464
This commit is contained in:
committed by
Marius Bogoevici
parent
1730021547
commit
12bd4effa1
@@ -47,6 +47,7 @@ public class AggregateApplicationBuilder {
|
||||
ConfigurableApplicationContext parentContext;
|
||||
|
||||
public AggregateApplicationBuilder() {
|
||||
this(SpringApplication.run(addAggregatorParentIfMissing(new Object[]{}), new String[]{}));
|
||||
}
|
||||
|
||||
public AggregateApplicationBuilder(Object source, String... args) {
|
||||
@@ -62,7 +63,6 @@ public class AggregateApplicationBuilder {
|
||||
}
|
||||
|
||||
private static Object[] addAggregatorParentIfMissing(Object[] sources) {
|
||||
Assert.notEmpty(sources, "At least one source must be provided");
|
||||
Object[] aggregateParentSources;
|
||||
if (!ObjectUtils.containsElement(sources, AggregatorParentConfiguration.class)) {
|
||||
// add the AggregatorParentConfiguration first, so it can be overridden
|
||||
|
||||
Reference in New Issue
Block a user