Package org.springframework.boot.autoconfigure.jdbc.metadata

Examples of org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProviders


  private final Map<String, DataSourcePoolMetadata> metadataByPrefix = new HashMap<String, DataSourcePoolMetadata>();

  @PostConstruct
  public void initialize() {
    DataSource primaryDataSource = getPrimaryDataSource();
    DataSourcePoolMetadataProvider provider = new DataSourcePoolMetadataProviders(
        this.providers);
    for (Map.Entry<String, DataSource> entry : this.applicationContext
        .getBeansOfType(DataSource.class).entrySet()) {
      String beanName = entry.getKey();
      DataSource bean = entry.getValue();
      String prefix = createPrefix(beanName, bean, bean.equals(primaryDataSource));
      DataSourcePoolMetadata poolMetadata = provider
          .getDataSourcePoolMetadata(bean);
      if (poolMetadata != null) {
        this.metadataByPrefix.put(prefix, poolMetadata);
      }
    }
View Full Code Here


        .emptyList();

    @Bean
    @ConditionalOnMissingBean(name = "dbHealthIndicator")
    public HealthIndicator dbHealthIndicator() {
      DataSourcePoolMetadataProvider metadataProvider = new DataSourcePoolMetadataProviders(
          this.metadataProviders);
      if (this.dataSources.size() == 1) {
        DataSource dataSource = this.dataSources.values().iterator().next();
        return createDataSourceHealthIndicator(metadataProvider, dataSource);
      }
View Full Code Here

TOP

Related Classes of org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadataProviders

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.