Class TomcatDataSourcePoolMetadata
java.lang.Object
io.micronaut.jdbc.metadata.AbstractDataSourcePoolMetadata<org.apache.tomcat.jdbc.pool.DataSource>
io.micronaut.configuration.jdbc.tomcat.metadata.TomcatDataSourcePoolMetadata
- All Implemented Interfaces:
DataSourcePoolMetadata<org.apache.tomcat.jdbc.pool.DataSource>
public class TomcatDataSourcePoolMetadata
extends AbstractDataSourcePoolMetadata<org.apache.tomcat.jdbc.pool.DataSource>
DataSourcePoolMetadata
for a Tomcat DataSource
.- Since:
- 1.0.0
- Author:
- Stephane Nicoll, Christian Oestreich
-
Constructor Summary
ConstructorDescriptionTomcatDataSourcePoolMetadata
(org.apache.tomcat.jdbc.pool.DataSource dataSource) Tomcat typedDataSourcePoolMetadata
object. -
Method Summary
Modifier and TypeMethodDescriptionReturn the current number of active connections that have been allocated from the data source ornull
if that information is not available.final long
Return the number of connections that have been borrowed from the data source or 0 if that information is not available.The default auto-commit state of connections created by this pool.getIdle()
Return the number of idle connections in the pool.getMax()
Return the maximum number of active connections that can be allocated at the same time or-1
if there is no limit.getMin()
Return the minimum number of idle connections in the pool ornull
if that information is not available.final long
Return the number of connections that have been released from the data source or 0 if that information is not available.Return the query to use to validate that a connection is valid ornull
if that information is not available.Methods inherited from class io.micronaut.jdbc.metadata.AbstractDataSourcePoolMetadata
getDataSource, getUsage
-
Constructor Details
-
TomcatDataSourcePoolMetadata
public TomcatDataSourcePoolMetadata(org.apache.tomcat.jdbc.pool.DataSource dataSource) Tomcat typedDataSourcePoolMetadata
object.- Parameters:
dataSource
- The datasource
-
-
Method Details
-
getIdle
Description copied from interface:DataSourcePoolMetadata
Return the number of idle connections in the pool.- Returns:
- the idle value
-
getActive
Description copied from interface:DataSourcePoolMetadata
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
-
getBorrowed
public final long getBorrowed()Return the number of connections that have been borrowed from the data source or 0 if that information is not available.- Returns:
- the number of borrowed connections or 0
-
getReleasedCount
public final long getReleasedCount()Return the number of connections that have been released from the data source or 0 if that information is not available.- Returns:
- the number of borrowed connections or 0
-
getMax
Description copied from interface:DataSourcePoolMetadata
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
Description copied from interface:DataSourcePoolMetadata
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
Description copied from interface:DataSourcePoolMetadata
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
Description copied from interface:DataSourcePoolMetadata
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
-