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:
Ilayaperumal Gopinathan
2016-04-01 20:56:31 +05:30
committed by Marius Bogoevici
parent 1730021547
commit 12bd4effa1

View File

@@ -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