|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ConnectionPool
Defines a simple connection pool.
Method Summary | |
---|---|
void |
close()
Closes this connection pool, disconnection connections as they are checked in |
int |
getCleanupInterval()
|
PoolableConnection |
getConnection()
Fetches a connection from the pool. |
int |
getConnectionTimeout()
|
int |
getMaximumCheckOutTime()
|
int |
getMaximumPoolSize()
|
int |
getMaximumRetryWaitPeriod()
|
int |
getMinimumPoolSize()
|
int |
getNewConnectionThreshold()
|
ConnectionPoolStatistics |
getStatistics(long since)
Retrives usage statistics for the connection pool since time since . |
User |
getUser()
|
boolean |
isCollectFineGrainedStatistics()
|
boolean |
isEnabled()
|
void |
resetStatistics()
Resets the collected usage statistics |
void |
returnConnection(PoolableConnection connection)
Return the given connection to the pool. |
void |
setCleanupInterval(int poolCleanupInterval)
|
void |
setCollectFineGrainedStatistics(boolean value)
Specifies whether or not fine grained usage statistics should be collected. |
void |
setConnectionTimeout(int timeout)
|
void |
setEnabled(boolean enabled)
|
void |
setMaximumCheckOutTime(int value)
|
void |
setMaximumPoolSize(int value)
|
void |
setMaximumRetryWaitPeriod(int maximumRetryWaitPeriod)
|
void |
setMinimumPoolSize(int value)
|
void |
setNewConnectionThreshold(int value)
|
Method Detail |
---|
User getUser()
PoolableConnection getConnection() throws ClassNotFoundException, SQLException
ConnectionPoolException.NoConnectionAvailable
- in case the maximum check out time is exceeded
ClassNotFoundException
- in case the JDBC driver class is not found
SQLException
- in case of a database exception
IllegalStateException
- if the pool is closedsetMaximumCheckOutTime(int)
void returnConnection(PoolableConnection connection)
connection
- the database connection to return to the poolvoid close()
ConnectionPoolStatistics getStatistics(long since)
since
.
since
- the time from which statistics should be retrieved
void resetStatistics()
boolean isCollectFineGrainedStatistics()
getStatistics(long)
,
ConnectionPoolStatistics.getFineGrainedStatistics()
void setCollectFineGrainedStatistics(boolean value)
value
- the valuegetStatistics(long)
,
ConnectionPoolStatistics.getFineGrainedStatistics()
boolean isEnabled()
void setEnabled(boolean enabled)
enabled
- true to enable this pool, false to disableint getCleanupInterval()
void setCleanupInterval(int poolCleanupInterval)
poolCleanupInterval
- the pool cleanup interval in millisecondsint getConnectionTimeout()
void setConnectionTimeout(int timeout)
timeout
- the connection timeout in millisecondsint getMaximumRetryWaitPeriod()
void setMaximumRetryWaitPeriod(int maximumRetryWaitPeriod)
maximumRetryWaitPeriod
- the maximum number of milliseconds the pool waits between checkout retriesint getMinimumPoolSize()
void setMinimumPoolSize(int value)
value
- the minimum number of connections to keep in the pool
IllegalArgumentException
- if value is less than 0 or larger than maximum pool sizeint getMaximumPoolSize()
void setMaximumPoolSize(int value)
value
- the maximum number of connections this pool can create
IllegalArgumentException
- if value is less than 1 or less than minimum pool sizeint getMaximumCheckOutTime()
ConnectionPoolException.NoConnectionAvailable
void setMaximumCheckOutTime(int value)
value
- the maximum number of milliseconds to retry connection checkout before throwing an exception
IllegalArgumentException
- if value is less than 0int getNewConnectionThreshold()
void setNewConnectionThreshold(int value)
value
- the time to wait before creating a new connection in ms
IllegalArgumentException
- in case value is negative or larger than maximumCheckOutTime
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |