this.metadataProviders);
if (this.dataSources.size() == 1) {
DataSource dataSource = this.dataSources.values().iterator().next();
return createDataSourceHealthIndicator(metadataProvider, dataSource);
}
CompositeHealthIndicator composite = new CompositeHealthIndicator(
this.healthAggregator);
for (Map.Entry<String, DataSource> entry : this.dataSources.entrySet()) {
String name = entry.getKey();
DataSource dataSource = entry.getValue();
composite.addHealthIndicator(name,
createDataSourceHealthIndicator(metadataProvider, dataSource));
}
return composite;
}