Package org.hibernate.testing.jdbc.leak
Class PostgreSQLIdleConnectionCounter
- java.lang.Object
-
- org.hibernate.testing.jdbc.leak.PostgreSQLIdleConnectionCounter
-
- All Implemented Interfaces:
IdleConnectionCounter
public class PostgreSQLIdleConnectionCounter extends Object implements IdleConnectionCounter
-
-
Field Summary
Fields Modifier and Type Field Description static IdleConnectionCounterINSTANCE
-
Constructor Summary
Constructors Constructor Description PostgreSQLIdleConnectionCounter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanappliesTo(Class<? extends org.hibernate.dialect.Dialect> dialect)Specifies which Dialect the counter applies to.intcount(Connection connection)Count the number of idle connections.
-
-
-
Field Detail
-
INSTANCE
public static final IdleConnectionCounter INSTANCE
-
-
Method Detail
-
appliesTo
public boolean appliesTo(Class<? extends org.hibernate.dialect.Dialect> dialect)
Description copied from interface:IdleConnectionCounterSpecifies which Dialect the counter applies to.- Specified by:
appliesToin interfaceIdleConnectionCounter- Parameters:
dialect- dialect- Returns:
- applicability.
-
count
public int count(Connection connection)
Description copied from interface:IdleConnectionCounterCount the number of idle connections.- Specified by:
countin interfaceIdleConnectionCounter- Parameters:
connection- current JDBC connection to be used for querying the number of idle connections.- Returns:
- idle connection count.
-
-