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

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


    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


    Set<Metric<?>> metrics = new LinkedHashSet<Metric<?>>();
    for (Map.Entry<String, DataSourcePoolMetadata> entry : this.metadataByPrefix
        .entrySet()) {
      String prefix = entry.getKey();
      prefix = (prefix.endsWith(".") ? prefix : prefix + ".");
      DataSourcePoolMetadata metadata = entry.getValue();
      addMetric(metrics, prefix + "active", metadata.getActive());
      addMetric(metrics, prefix + "usage", metadata.getUsage());
    }
    return metrics;
  }
View Full Code Here

    }

    private DataSourceHealthIndicator createDataSourceHealthIndicator(
        DataSourcePoolMetadataProvider provider, DataSource dataSource) {
      String validationQuery = null;
      DataSourcePoolMetadata poolMetadata = provider
          .getDataSourcePoolMetadata(dataSource);
      if (poolMetadata != null) {
        validationQuery = poolMetadata.getValidationQuery();
      }
      return new DataSourceHealthIndicator(dataSource, validationQuery);
    }
View Full Code Here

TOP

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

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.