public final class ConnectionPoolConfig extends PoolConfig<Connection,StardogException>
A configuration object for creating connection pools.
mConfig, mMinPool
Modifier and Type | Method and Description |
---|---|
ConnectionPoolConfig |
blockAtCapacity(long theTime,
TimeUnit theUnit)
Set the amount of time to wait to obtain an object.
|
ConnectionPool |
create()
Create the Pool
|
ConnectionPoolConfig |
expiration(long theTime,
TimeUnit theUnit)
Specifes the minimum amount of time something should remain idle for before it is eligible to be expired.
|
ConnectionPoolConfig |
failAtCapacity()
Configure the pool to fail to obtain an object if you are at
PoolConfig.maxPool(int) objects. |
ConnectionPoolConfig |
growAtCapacity()
Configure the pool to grow if it is at
PoolConfig.maxPool(int) objects, effectively rendering the max moot. |
ConnectionPoolConfig |
maxIdle(int theMaxIdle)
The maximum number of objects which are allowed to sit idle in the pool.
|
ConnectionPoolConfig |
maxPool(int theMax)
Set the maximum number of objects that can be active in the pool (leased or idle).
|
ConnectionPoolConfig |
minPool(int theMin)
Set the minimum size of the pool, ie, the number of objects to start with.
|
ConnectionPoolConfig |
noExpiration()
Set that entries should not timeout/expire while idle
|
static ConnectionPoolConfig |
using(ConnectionConfiguration theConfig)
Create a new ConnectionPoolConfig for the provided ConnectionConfiguration.
|
public static ConnectionPoolConfig using(ConnectionConfiguration theConfig)
theConfig
- the configurationpublic ConnectionPoolConfig maxIdle(int theMaxIdle)
maxIdle
in class PoolConfig<Connection,StardogException>
theMaxIdle
- the max idlepublic ConnectionPoolConfig maxPool(int theMax)
maxPool
in class PoolConfig<Connection,StardogException>
theMax
- the maxpublic ConnectionPoolConfig minPool(int theMin)
minPool
in class PoolConfig<Connection,StardogException>
theMin
- the min pool sizepublic ConnectionPoolConfig growAtCapacity()
PoolConfig.maxPool(int)
objects, effectively rendering the max moot.growAtCapacity
in class PoolConfig<Connection,StardogException>
public ConnectionPoolConfig failAtCapacity()
PoolConfig.maxPool(int)
objects.failAtCapacity
in class PoolConfig<Connection,StardogException>
public ConnectionPoolConfig blockAtCapacity(long theTime, TimeUnit theUnit)
Pool.obtain()
block the specified amount of time until an object can be obtained.
If the max is reached, obtain will return null. The default is that it will block indefinitely (-1 value for theTime).blockAtCapacity
in class PoolConfig<Connection,StardogException>
theTime
- the time to waittheUnit
- the unit of timepublic ConnectionPoolConfig noExpiration()
noExpiration
in class PoolConfig<Connection,StardogException>
public ConnectionPoolConfig expiration(long theTime, TimeUnit theUnit)
expiration
in class PoolConfig<Connection,StardogException>
theTime
- the amount of timetheUnit
- the unit of timepublic ConnectionPool create()
create
in class PoolConfig<Connection,StardogException>
Copyright © 2010-2016 Stardog Union. All Rights Reserved.