类 AbstractDataSourcePoolMetadata<T extends DataSource>
- java.lang.Object
- org.springframework.boot.autoconfigure.jdbc.metadata.AbstractDataSourcePoolMetadata<T>
- 类型参数:
T- the data source type
- 所有已实现的接口:
DataSourcePoolMetadata
- 直接已知子类:
CommonsDbcp2DataSourcePoolMetadata,CommonsDbcpDataSourcePoolMetadata,HikariDataSourcePoolMetadata,TomcatDataSourcePoolMetadata
public abstract class AbstractDataSourcePoolMetadata<T extends DataSource> extends Object implements DataSourcePoolMetadata
A baseDataSourcePoolMetadataimplementation.- 从以下版本开始:
- 1.2.0
构造器概要
构造器 限定符 构造器 说明 protectedAbstractDataSourcePoolMetadata(T dataSource)Create an instance with the data source to use.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected TgetDataSource()FloatgetUsage()Return the usage of the pool as value between 0 and 1 (or -1 if the pool is not limited).从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 org.springframework.boot.autoconfigure.jdbc.metadata.DataSourcePoolMetadata
getActive, getMax, getMin, getValidationQuery
构造器详细资料
AbstractDataSourcePoolMetadata
protected AbstractDataSourcePoolMetadata(T dataSource)
Create an instance with the data source to use.- 参数:
dataSource- the data source
方法详细资料
getUsage
public Float getUsage()
从接口复制的说明: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.- 指定者:
getUsage在接口中DataSourcePoolMetadata- 返回:
- the usage value or
null
getDataSource
protected final T getDataSource()