Class PoolConfig
java.lang.Object
org.springframework.ldap.pool2.factory.PoolConfig
A wrapper class for the pool configuration. It helps to create an instance of
GenericKeyedObjectPoolConfig.- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the name of the eviction policy class.@Nullable StringGet the base name to use for JMX naming.Get the JMX name prefix.intGet the maximum number of idle instances per key.intGet the overall maximum number of objects that can exist in this pool.intGet the maximum number of objects that can exist in this pool for a given key.longGet the maximum time to wait for an object to become available.longGet the minimum time an object may sit idle before being eligible for eviction.intGet the minimum number of idle instances per key.intGet the number of objects to examine during each eviction run.longGet the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.longGet the time between runs of the idle object evictor.booleanReturn whether to block when the pool is exhausted.booleanReturn whether waiting threads are served as if waiting in a FIFO queue.booleanReturn whether JMX is enabled for this pool.booleanisLifo()Return whether the pool acts as a LIFO queue.booleanReturn whether objects are validated before being borrowed from the pool.booleanReturn whether objects are validated after creation.booleanReturn whether objects are validated before being returned to the pool.booleanReturn whether idle objects are validated by the idle object evictor.voidsetBlockWhenExhausted(boolean blockWhenExhausted) Set whether to block when the pool is exhausted.voidsetEvictionPolicyClassName(String evictionPolicyClassName) Set the name of the eviction policy class.voidsetFairness(boolean fairness) Set whether waiting threads are served as if waiting in a FIFO queue.voidsetJmxEnabled(boolean jmxEnabled) Set whether JMX is enabled for this pool.voidsetJmxNameBase(@Nullable String jmxNameBase) Set the base name to use for JMX naming.voidsetJmxNamePrefix(String jmxNamePrefix) Set the JMX name prefix.voidsetLifo(boolean lifo) Set whether the pool acts as a LIFO queue.voidsetMaxIdlePerKey(int maxIdlePerKey) Set the maximum number of idle instances per key.voidsetMaxTotal(int maxTotal) Set the overall maximum number of objects that can exist in this pool.voidsetMaxTotalPerKey(int maxTotalPerKey) Set the maximum number of objects that can exist in this pool for a given key.voidsetMaxWaitMillis(long maxWaitMillis) Set the maximum time to wait for an object to become available.voidsetMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) Set the minimum time an object may sit idle before being eligible for eviction.voidsetMinIdlePerKey(int minIdlePerKey) Set the minimum number of idle instances per key.voidsetNumTestsPerEvictionRun(int numTestsPerEvictionRun) Set the number of objects to examine during each eviction run.voidsetSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) Set the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.voidsetTestOnBorrow(boolean testOnBorrow) Set whether objects are validated before being borrowed from the pool.voidsetTestOnCreate(boolean testOnCreate) Set whether objects are validated after creation.voidsetTestOnReturn(boolean testOnReturn) Set whether objects are validated before being returned to the pool.voidsetTestWhileIdle(boolean testWhileIdle) Set whether idle objects are validated by the idle object evictor.voidsetTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) Set the time between runs of the idle object evictor.
-
Constructor Details
-
PoolConfig
public PoolConfig()
-
-
Method Details
-
setMaxIdlePerKey
public void setMaxIdlePerKey(int maxIdlePerKey) Set the maximum number of idle instances per key.- See Also:
-
setMaxTotal
public void setMaxTotal(int maxTotal) Set the overall maximum number of objects that can exist in this pool.- See Also:
-
setMaxTotalPerKey
public void setMaxTotalPerKey(int maxTotalPerKey) Set the maximum number of objects that can exist in this pool for a given key.- See Also:
-
setMinIdlePerKey
public void setMinIdlePerKey(int minIdlePerKey) Set the minimum number of idle instances per key.- See Also:
-
setBlockWhenExhausted
public void setBlockWhenExhausted(boolean blockWhenExhausted) Set whether to block when the pool is exhausted.- See Also:
-
setEvictionPolicyClassName
Set the name of the eviction policy class.- See Also:
-
setFairness
public void setFairness(boolean fairness) Set whether waiting threads are served as if waiting in a FIFO queue.- See Also:
-
setJmxEnabled
public void setJmxEnabled(boolean jmxEnabled) Set whether JMX is enabled for this pool.- See Also:
-
setJmxNameBase
Set the base name to use for JMX naming.- See Also:
-
setJmxNamePrefix
-
setLifo
public void setLifo(boolean lifo) Set whether the pool acts as a LIFO queue.- See Also:
-
setMaxWaitMillis
public void setMaxWaitMillis(long maxWaitMillis) Set the maximum time to wait for an object to become available.- See Also:
-
setMinEvictableIdleTimeMillis
public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) Set the minimum time an object may sit idle before being eligible for eviction.- See Also:
-
setNumTestsPerEvictionRun
public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun) Set the number of objects to examine during each eviction run.- See Also:
-
setSoftMinEvictableIdleTimeMillis
public void setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis) Set the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.- See Also:
-
setTestOnBorrow
public void setTestOnBorrow(boolean testOnBorrow) Set whether objects are validated before being borrowed from the pool.- See Also:
-
setTestOnCreate
public void setTestOnCreate(boolean testOnCreate) Set whether objects are validated after creation.- See Also:
-
setTestOnReturn
public void setTestOnReturn(boolean testOnReturn) Set whether objects are validated before being returned to the pool.- See Also:
-
setTestWhileIdle
public void setTestWhileIdle(boolean testWhileIdle) Set whether idle objects are validated by the idle object evictor.- See Also:
-
setTimeBetweenEvictionRunsMillis
public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) Set the time between runs of the idle object evictor.- See Also:
-
getMaxIdlePerKey
public int getMaxIdlePerKey()Get the maximum number of idle instances per key.- See Also:
-
getMaxTotal
public int getMaxTotal()Get the overall maximum number of objects that can exist in this pool.- See Also:
-
getMaxTotalPerKey
public int getMaxTotalPerKey()Get the maximum number of objects that can exist in this pool for a given key.- See Also:
-
getMinIdlePerKey
public int getMinIdlePerKey()Get the minimum number of idle instances per key.- See Also:
-
isBlockWhenExhausted
public boolean isBlockWhenExhausted()Return whether to block when the pool is exhausted.- See Also:
-
getEvictionPolicyClassName
-
isFairness
public boolean isFairness()Return whether waiting threads are served as if waiting in a FIFO queue.- See Also:
-
isJmxEnabled
public boolean isJmxEnabled()Return whether JMX is enabled for this pool.- See Also:
-
getJmxNameBase
-
getJmxNamePrefix
-
isLifo
public boolean isLifo()Return whether the pool acts as a LIFO queue.- See Also:
-
getMaxWaitMillis
public long getMaxWaitMillis()Get the maximum time to wait for an object to become available.- See Also:
-
getMinEvictableIdleTimeMillis
public long getMinEvictableIdleTimeMillis()Get the minimum time an object may sit idle before being eligible for eviction.- See Also:
-
getNumTestsPerEvictionRun
public int getNumTestsPerEvictionRun()Get the number of objects to examine during each eviction run.- See Also:
-
getSoftMinEvictableIdleTimeMillis
public long getSoftMinEvictableIdleTimeMillis()Get the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.- See Also:
-
isTestOnBorrow
public boolean isTestOnBorrow()Return whether objects are validated before being borrowed from the pool.- See Also:
-
isTestOnCreate
public boolean isTestOnCreate()Return whether objects are validated after creation.- See Also:
-
isTestOnReturn
public boolean isTestOnReturn()Return whether objects are validated before being returned to the pool.- See Also:
-
isTestWhileIdle
public boolean isTestWhileIdle()Return whether idle objects are validated by the idle object evictor.- See Also:
-
getTimeBetweenEvictionRunsMillis
public long getTimeBetweenEvictionRunsMillis()Get the time between runs of the idle object evictor.- See Also:
-