diff --git a/.gitignore b/.gitignore
index 0dd7fdbd6..214f0bcb3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,6 +12,8 @@ _site/
.project
.settings
.springBeans
+.sts4-cache/
+.attach_pid*
.DS_Store
*.sw*
*.iml
diff --git a/spring-cloud-stream/pom.xml b/spring-cloud-stream/pom.xml
index e8d62b9e8..7e6df0444 100644
--- a/spring-cloud-stream/pom.xml
+++ b/spring-cloud-stream/pom.xml
@@ -17,6 +17,7 @@
org.springframework.boot
spring-boot-starter-actuator
+ true
org.springframework.boot
diff --git a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java
index cc29d2ec3..2ba290746 100644
--- a/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java
+++ b/spring-cloud-stream/src/main/java/org/springframework/cloud/stream/aggregate/AggregateApplicationBuilder.java
@@ -60,8 +60,8 @@ import org.springframework.util.StringUtils;
* @author Oleg Zhurakousky
*/
@EnableBinding
-public class AggregateApplicationBuilder implements AggregateApplication, ApplicationContextAware,
- SmartInitializingSingleton {
+public class AggregateApplicationBuilder implements AggregateApplication,
+ ApplicationContextAware, SmartInitializingSingleton {
private static final String CHILD_CONTEXT_SUFFIX = ".spring.cloud.stream.context";
@@ -106,6 +106,11 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
private void addParentSources(Object[] sources) {
if (!this.parentSources.contains(ParentConfiguration.class)) {
this.parentSources.add(ParentConfiguration.class);
+ if (ClassUtils.isPresent(
+ "org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration",
+ null)) {
+ this.parentSources.add(ParentActuatorConfiguration.class);
+ }
}
this.parentSources.addAll(Arrays.asList(sources));
}
@@ -150,23 +155,25 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
}
@Override
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ public void setApplicationContext(ApplicationContext applicationContext)
+ throws BeansException {
this.parentContext = (ConfigurableApplicationContext) applicationContext;
}
@Override
public T getBinding(Class bindableType, String namespace) {
if (parentContext == null) {
- throw new IllegalStateException("The aggregate application has not been started yet");
+ throw new IllegalStateException(
+ "The aggregate application has not been started yet");
}
try {
- ChildContextHolder contextHolder = parentContext.getBean(namespace + CHILD_CONTEXT_SUFFIX,
- ChildContextHolder.class);
+ ChildContextHolder contextHolder = parentContext
+ .getBean(namespace + CHILD_CONTEXT_SUFFIX, ChildContextHolder.class);
return contextHolder.getChildContext().getBean(bindableType);
}
catch (BeansException e) {
- throw new IllegalStateException("Binding not found for '" + bindableType.getName() + "' into namespace " +
- namespace);
+ throw new IllegalStateException("Binding not found for '"
+ + bindableType.getName() + "' into namespace " + namespace);
}
}
@@ -200,35 +207,41 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
// to remove illegal characters for new properties
// binder
// org.springframework.cloud.stream.aggregation.AggregationTest$TestSource
- appConfigurer.namespace = AggregateApplicationUtils
- .getDefaultNamespace(appConfigurer.getApp().getName().replaceAll("\\$", "."), i);
+ appConfigurer.namespace = AggregateApplicationUtils.getDefaultNamespace(
+ appConfigurer.getApp().getName().replaceAll("\\$", "."), i);
}
appsToEmbed.put(appToEmbed, appConfigurer.namespace);
appConfigurers.put(appConfigurer, appConfigurer.namespace);
}
if (this.parentContext == null) {
if (Boolean.TRUE.equals(this.webEnvironment)) {
- Assert.isTrue(ClassUtils.isPresent("javax.servlet.ServletRequest", ClassUtils.getDefaultClassLoader()),
+ Assert.isTrue(
+ ClassUtils.isPresent("javax.servlet.ServletRequest",
+ ClassUtils.getDefaultClassLoader()),
"'webEnvironment' is set to 'true' but 'javax.servlet.*' does not appear to be available in "
- + "the classpath. Consider adding `org.springframework.boot:spring-boot-starter-web");
- this.addParentSources(new Object[] { ServletWebServerFactoryAutoConfiguration.class });
+ + "the classpath. Consider adding `org.springframework.boot:spring-boot-starter-web");
+ this.addParentSources(
+ new Object[] { ServletWebServerFactoryAutoConfiguration.class });
}
this.parentContext = AggregateApplicationUtils.createParentContext(
this.parentSources.toArray(new Class>[0]),
- this.parentArgs.toArray(new String[0]), selfContained(), this.webEnvironment, this.headless);
+ this.parentArgs.toArray(new String[0]), selfContained(),
+ this.webEnvironment, this.headless);
}
else {
- if (BeanFactoryUtils.beansOfTypeIncludingAncestors(this.parentContext, SharedBindingTargetRegistry.class)
- .size() == 0) {
+ if (BeanFactoryUtils.beansOfTypeIncludingAncestors(this.parentContext,
+ SharedBindingTargetRegistry.class).size() == 0) {
SharedBindingTargetRegistry sharedBindingTargetRegistry = new SharedBindingTargetRegistry();
- this.parentContext.getBeanFactory().registerSingleton("sharedBindingTargetRegistry",
- sharedBindingTargetRegistry);
+ this.parentContext.getBeanFactory().registerSingleton(
+ "sharedBindingTargetRegistry", sharedBindingTargetRegistry);
}
}
SharedBindingTargetRegistry sharedBindingTargetRegistry = this.parentContext
.getBean(SharedBindingTargetRegistry.class);
- AggregateApplicationUtils.prepareSharedBindingTargetRegistry(sharedBindingTargetRegistry, appsToEmbed);
- for (Map.Entry, String> appConfigurerEntry : appConfigurers.entrySet()) {
+ AggregateApplicationUtils.prepareSharedBindingTargetRegistry(
+ sharedBindingTargetRegistry, appsToEmbed);
+ for (Map.Entry, String> appConfigurerEntry : appConfigurers
+ .entrySet()) {
AppConfigurer> appConfigurer = appConfigurerEntry.getKey();
if (appConfigurerEntry.getValue() == null) {
@@ -237,7 +250,8 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
String namespace = appConfigurerEntry.getValue().toLowerCase();
Set argsToUpdate = new LinkedHashSet<>();
Set argKeys = new LinkedHashSet<>();
- Map target = bindProperties(namespace, this.parentContext.getEnvironment());
+ Map target = bindProperties(namespace,
+ this.parentContext.getEnvironment());
if (!target.isEmpty()) {
for (Map.Entry entry : target.entrySet()) {
@@ -255,9 +269,10 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
AppConfigurer> appConfigurer = apps.get(i);
appConfigurer.embed();
}
- if (BeanFactoryUtils.beansOfTypeIncludingAncestors(this.parentContext, AggregateApplication.class)
- .size() == 0) {
- this.parentContext.getBeanFactory().registerSingleton("aggregateApplicationAccessor", this);
+ if (BeanFactoryUtils.beansOfTypeIncludingAncestors(this.parentContext,
+ AggregateApplication.class).size() == 0) {
+ this.parentContext.getBeanFactory()
+ .registerSingleton("aggregateApplicationAccessor", this);
}
return this.parentContext;
}
@@ -266,14 +281,16 @@ public class AggregateApplicationBuilder implements AggregateApplication, Applic
return (this.sourceConfigurer != null) && (this.sinkConfigurer != null);
}
- private ChildContextBuilder childContext(Class> app, ConfigurableApplicationContext parentContext,
- String namespace) {
- return new ChildContextBuilder(AggregateApplicationUtils.embedApp(parentContext, namespace, app));
+ private ChildContextBuilder childContext(Class> app,
+ ConfigurableApplicationContext parentContext, String namespace) {
+ return new ChildContextBuilder(
+ AggregateApplicationUtils.embedApp(parentContext, namespace, app));
}
private Map bindProperties(String namepace, Environment environment) {
Map target;
- BindResult