Class AbstractDataSourcePoolMetadata<T extends DataSource>
java.lang.Object
org.springframework.boot.jdbc.metadata.AbstractDataSourcePoolMetadata<T>
- Type Parameters:
 T- the data source type
- All Implemented Interfaces:
 DataSourcePoolMetadata
- Direct Known Subclasses:
 CommonsDbcp2DataSourcePoolMetadata, HikariDataSourcePoolMetadata, OracleUcpDataSourcePoolMetadata, TomcatDataSourcePoolMetadata
public abstract class AbstractDataSourcePoolMetadata<T extends DataSource>
extends Object
implements DataSourcePoolMetadata
A base 
DataSourcePoolMetadata implementation.- Since:
 - 2.0.0
 - Author:
 - Stephane Nicoll
 
- 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractDataSourcePoolMetadata(T dataSource) Create an instance with the data source to use. - 
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DataSourcePoolMetadata
getActive, getDefaultAutoCommit, getIdle, getMax, getMin, getValidationQuery 
- 
Constructor Details
- 
AbstractDataSourcePoolMetadata
Create an instance with the data source to use.- Parameters:
 dataSource- the data source
 
 - 
 - 
Method Details
- 
getUsage
Description copied from interface:DataSourcePoolMetadataReturn 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
 
nullif the data source does not provide the necessary information to compute the poll usage.- Specified by:
 getUsagein interfaceDataSourcePoolMetadata- Returns:
 - the usage value or 
null 
 - 
getDataSource
 
 -