org.springframework.boot.jdbc.metadata

Class AbstractDataSourcePoolMetadata<T extends javax.sql.DataSource>

  • java.lang.Object
    • org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata<T>
    • Constructor Detail

      • AbstractDataSourcePoolMetadata

        protected AbstractDataSourcePoolMetadata(T dataSource)
        Create an instance with the data source to use.
        Parameters:
        dataSource - the data source
    • Method Detail

      • getUsage

        public java.lang.Float getUsage()
        Description copied from interface: DataSourcePoolMetadata
        Return the usage of the pool as value between 0 and 1 (or -1 if the pool is not limited).
        • 1 means that the maximum number of connections have been allocated
        • 0 means that no connection is currently active
        • -1 means there is not limit to the number of connections that can be allocated
        This may also return null if the data source does not provide the necessary information to compute the poll usage.
        Specified by:
        getUsage in interface DataSourcePoolMetadata
        Returns:
        the usage value or null
      • getDataSource

        protected final T getDataSource()