Package io.micronaut.jdbc.metadata
Interface DataSourcePoolMetadata<T extends javax.sql.DataSource>
-
- Type Parameters:
T
- datasourceDataSource
- All Known Implementing Classes:
AbstractDataSourcePoolMetadata
,DbcpDataSourcePoolMetadata
,TomcatDataSourcePoolMetadata
public interface DataSourcePoolMetadata<T extends javax.sql.DataSource>
Provides access meta-data that is commonly available from most pooledDataSource
implementations.- Since:
- 2.0.0
- Author:
- Stephane Nicoll, Christian Oestreich
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Integer
getActive()
Return the current number of active connections that have been allocated from the data source ornull
if that information is not available.T
getDataSource()
Allow implementations to get the datasource for usage in metrics, etc.java.lang.Boolean
getDefaultAutoCommit()
The default auto-commit state of connections created by this pool.java.lang.Integer
getIdle()
Return the number of idle connections in the pool.java.lang.Integer
getMax()
Return the maximum number of active connections that can be allocated at the same time or-1
if there is no limit.java.lang.Integer
getMin()
Return the minimum number of idle connections in the pool ornull
if that information is not available.java.lang.Float
getUsage()
Return the usage of the pool as value between 0 and 1 (or -1 if the pool is not limited).java.lang.String
getValidationQuery()
Return the query to use to validate that a connection is valid ornull
if that information is not available.
-
-
-
Method Detail
-
getDataSource
T getDataSource()
Allow implementations to get the datasource for usage in metrics, etc.- Returns:
- the datasource
-
getIdle
java.lang.Integer getIdle()
Return the number of idle connections in the pool.- Returns:
- the idle value
-
getUsage
java.lang.Float getUsage()
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
null
if the data source does not provide the necessary information to compute the poll usage.- Returns:
- the usage value or
null
-
getActive
java.lang.Integer getActive()
Return the current number of active connections that have been allocated from the data source ornull
if that information is not available.- Returns:
- the number of active connections or
null
-
getMax
java.lang.Integer getMax()
Return the maximum number of active connections that can be allocated at the same time or-1
if there is no limit. Can also returnnull
if that information is not available.- Returns:
- the maximum number of active connections or
null
-
getMin
java.lang.Integer getMin()
Return the minimum number of idle connections in the pool ornull
if that information is not available.- Returns:
- the minimum number of active connections or
null
-
getValidationQuery
java.lang.String getValidationQuery()
Return the query to use to validate that a connection is valid ornull
if that information is not available.- Returns:
- the validation query or
null
-
getDefaultAutoCommit
java.lang.Boolean getDefaultAutoCommit()
The default auto-commit state of connections created by this pool. If not set (null
), default is JDBC driver default (If set to null then the java.sql.Connection.setAutoCommit(boolean) method will not be called.)- Returns:
- the default auto-commit state or
null
-
-