public class SoftLimitConnectionPool extends BlockingConnectionPool
PruneStrategy
. This implementation should be used when you have some flexibility in the
number of connections that can be created to handle spikes in load. See AbstractConnectionPool
. Note that
this pool will begin blocking if it cannot create new connections.AbstractConnectionPool.DefaultPooledConnectionProxy
active, available, checkInLock, checkOutLock, poolLock, poolNotEmpty
logger
Constructor and Description |
---|
SoftLimitConnectionPool()
Creates a new soft limit pool.
|
SoftLimitConnectionPool(DefaultConnectionFactory cf)
Creates a new soft limit pool.
|
SoftLimitConnectionPool(PoolConfig pc,
DefaultConnectionFactory cf)
Creates a new soft limit pool.
|
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Returns a connection from the pool.
|
blockAvailableConnection, getBlockWaitTime, putConnection, retrieveAvailableConnection, setBlockWaitTime
activateAndValidateConnection, activeCount, availableCount, close, createActiveConnection, createActiveConnection, createAvailableConnection, createAvailableConnection, createConnection, createConnection, createConnectionProxy, finalize, getConnectionFactory, getConnectOnCreate, getFailFastInitialize, getPooledConnectionStatistics, getQueueType, grow, grow, initialize, isInitialized, prune, removeActiveConnection, removeAvailableAndActiveConnection, removeAvailableConnection, retrieveConnectionProxy, setConnectionFactory, setConnectOnCreate, setFailFastInitialize, setQueueType, throwIfNotInitialized, toString, validate, validateAndPassivateConnection
activate, getActivator, getName, getPassivator, getPoolConfig, getPruneStrategy, getValidator, passivate, setActivator, setName, setPassivator, setPoolConfig, setPruneStrategy, setValidator, validate
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getActivator, getPassivator, getValidator, setActivator, setPassivator, setValidator
public SoftLimitConnectionPool()
public SoftLimitConnectionPool(DefaultConnectionFactory cf)
cf
- connection factorypublic SoftLimitConnectionPool(PoolConfig pc, DefaultConnectionFactory cf)
pc
- pool configurationcf
- connection factorypublic Connection getConnection() throws PoolException
AbstractConnectionPool
getConnection
in interface ConnectionPool
getConnection
in class BlockingConnectionPool
PoolException
- if this operation failsBlockingTimeoutException
- if this pool is configured with a block time and it occursPoolInterruptedException
- if this pool is configured with a block time and the current thread is
interruptedCopyright © 2003-2019 Virginia Tech. All Rights Reserved.