T
- the type representing the actual pool objectpublic abstract class AbstractConnectionPool<T> extends java.lang.Object implements ConnectionPool
ConnectionPool.Counter
Constructor and Description |
---|
AbstractConnectionPool(Database database,
User user) |
Modifier and Type | Method and Description |
---|---|
protected ConnectionPool.Counter |
getCounter() |
Database |
getDatabase() |
protected abstract int |
getInUse() |
protected T |
getPool() |
protected abstract int |
getSize() |
ConnectionPoolStatistics |
getStatistics(long since)
Retrives usage statistics for the connection pool since time
since . |
User |
getUser() |
protected abstract int |
getWaiting() |
protected java.lang.Object |
handleInvocation(Database database,
User user,
javax.sql.DataSource dataSource,
java.lang.reflect.Method dataSourceMethod,
java.lang.Object[] dataSourceArgs)
Handles a method invocation for this pool, counting created and destroyed connections.
|
boolean |
isCollectFineGrainedStatistics() |
void |
resetStatistics()
Resets the collected usage statistics
|
void |
setCollectFineGrainedStatistics(boolean collectFineGrainedStatistics)
Specifies whether or not fine grained usage statistics should be collected.
|
protected void |
setPool(T pool) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getCleanupInterval, getConnection, getConnectionTimeout, getMaximumCheckOutTime, getMaximumPoolSize, getMaximumRetryWaitPeriod, getMinimumPoolSize, getNewConnectionThreshold, returnConnection, setCleanupInterval, setConnectionTimeout, setMaximumCheckOutTime, setMaximumPoolSize, setMaximumRetryWaitPeriod, setMinimumPoolSize, setNewConnectionThreshold
public Database getDatabase()
getDatabase
in interface ConnectionPool
public final User getUser()
getUser
in interface ConnectionPool
public final void resetStatistics()
resetStatistics
in interface ConnectionPool
public final boolean isCollectFineGrainedStatistics()
isCollectFineGrainedStatistics
in interface ConnectionPool
ConnectionPool.getStatistics(long)
,
ConnectionPoolStatistics.getFineGrainedStatistics()
public final void setCollectFineGrainedStatistics(boolean collectFineGrainedStatistics)
setCollectFineGrainedStatistics
in interface ConnectionPool
collectFineGrainedStatistics
- the valueConnectionPool.getStatistics(long)
,
ConnectionPoolStatistics.getFineGrainedStatistics()
public final ConnectionPoolStatistics getStatistics(long since)
since
.getStatistics
in interface ConnectionPool
since
- the time from which statistics should be retrievedprotected void setPool(T pool)
pool
- the underlying connection poolprotected T getPool()
protected abstract int getSize()
protected abstract int getInUse()
protected abstract int getWaiting()
protected final ConnectionPool.Counter getCounter()
protected final java.lang.Object handleInvocation(Database database, User user, javax.sql.DataSource dataSource, java.lang.reflect.Method dataSourceMethod, java.lang.Object[] dataSourceArgs) throws DatabaseException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException
database
- the databaseuser
- the userdataSource
- the data sourcedataSourceMethod
- the data source method being calleddataSourceArgs
- the data source method argumentsDatabaseException
- in case of a an exceptionjava.lang.IllegalAccessException
- in case of illegal accessjava.lang.reflect.InvocationTargetException
- in case of invocation exception