@Configuration @ConditionalOnClass(value={org.springframework.jdbc.core.JdbcTemplate.class,org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource.class}) @ConditionalOnBean(value=javax.sql.DataSource.class) @ConditionalOnEnabledHealthIndicator(value="db") @AutoConfigureBefore(value=HealthIndicatorAutoConfiguration.class) @AutoConfigureAfter(value=DataSourceAutoConfiguration.class) public class DataSourceHealthIndicatorAutoConfiguration extends CompositeHealthIndicatorConfiguration<DataSourceHealthIndicator,DataSource> implements org.springframework.beans.factory.InitializingBean
Constructor and Description |
---|
DataSourceHealthIndicatorAutoConfiguration(Map<String,DataSource> dataSources,
org.springframework.beans.factory.ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
protected DataSourceHealthIndicator |
createHealthIndicator(DataSource source) |
HealthIndicator |
dbHealthIndicator() |
createHealthIndicator
public DataSourceHealthIndicatorAutoConfiguration(Map<String,DataSource> dataSources, org.springframework.beans.factory.ObjectProvider<DataSourcePoolMetadataProvider> metadataProviders)
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
@Bean @ConditionalOnMissingBean(name="dbHealthIndicator") public HealthIndicator dbHealthIndicator()
protected DataSourceHealthIndicator createHealthIndicator(DataSource source)
createHealthIndicator
in class CompositeHealthIndicatorConfiguration<DataSourceHealthIndicator,DataSource>
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.