Class PoolConfig

java.lang.Object
org.springframework.ldap.pool2.factory.PoolConfig

public class PoolConfig extends Object
A wrapper class for the pool configuration. It helps to create an instance of GenericKeyedObjectPoolConfig.
Since:
2.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the name of the eviction policy class.
    @Nullable String
    Get the base name to use for JMX naming.
    Get the JMX name prefix.
    int
    Get the maximum number of idle instances per key.
    int
    Get the overall maximum number of objects that can exist in this pool.
    int
    Get the maximum number of objects that can exist in this pool for a given key.
    long
    Get the maximum time to wait for an object to become available.
    long
    Get the minimum time an object may sit idle before being eligible for eviction.
    int
    Get the minimum number of idle instances per key.
    int
    Get the number of objects to examine during each eviction run.
    long
    Get the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.
    long
    Get the time between runs of the idle object evictor.
    boolean
    Return whether to block when the pool is exhausted.
    boolean
    Return whether waiting threads are served as if waiting in a FIFO queue.
    boolean
    Return whether JMX is enabled for this pool.
    boolean
    Return whether the pool acts as a LIFO queue.
    boolean
    Return whether objects are validated before being borrowed from the pool.
    boolean
    Return whether objects are validated after creation.
    boolean
    Return whether objects are validated before being returned to the pool.
    boolean
    Return whether idle objects are validated by the idle object evictor.
    void
    setBlockWhenExhausted(boolean blockWhenExhausted)
    Set whether to block when the pool is exhausted.
    void
    setEvictionPolicyClassName(String evictionPolicyClassName)
    Set the name of the eviction policy class.
    void
    setFairness(boolean fairness)
    Set whether waiting threads are served as if waiting in a FIFO queue.
    void
    setJmxEnabled(boolean jmxEnabled)
    Set whether JMX is enabled for this pool.
    void
    setJmxNameBase(@Nullable String jmxNameBase)
    Set the base name to use for JMX naming.
    void
    setJmxNamePrefix(String jmxNamePrefix)
    Set the JMX name prefix.
    void
    setLifo(boolean lifo)
    Set whether the pool acts as a LIFO queue.
    void
    setMaxIdlePerKey(int maxIdlePerKey)
    Set the maximum number of idle instances per key.
    void
    setMaxTotal(int maxTotal)
    Set the overall maximum number of objects that can exist in this pool.
    void
    setMaxTotalPerKey(int maxTotalPerKey)
    Set the maximum number of objects that can exist in this pool for a given key.
    void
    setMaxWaitMillis(long maxWaitMillis)
    Set the maximum time to wait for an object to become available.
    void
    setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
    Set the minimum time an object may sit idle before being eligible for eviction.
    void
    setMinIdlePerKey(int minIdlePerKey)
    Set the minimum number of idle instances per key.
    void
    setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
    Set the number of objects to examine during each eviction run.
    void
    setSoftMinEvictableIdleTimeMillis(long softMinEvictableIdleTimeMillis)
    Set the minimum time an object may sit idle before being eligible for eviction, subject to the minimum idle constraint.
    void
    setTestOnBorrow(boolean testOnBorrow)
    Set whether objects are validated before being borrowed from the pool.
    void
    setTestOnCreate(boolean testOnCreate)
    Set whether objects are validated after creation.
    void
    setTestOnReturn(boolean testOnReturn)
    Set whether objects are validated before being returned to the pool.
    void
    setTestWhileIdle(boolean testWhileIdle)
    Set whether idle objects are validated by the idle object evictor.
    void
    setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
    Set the time between runs of the idle object evictor.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PoolConfig

      public PoolConfig()
  • Method Details

    • setMaxIdlePerKey

      public void setMaxIdlePerKey(int maxIdlePerKey)
      Set the maximum number of idle instances per key.
      See Also:
      • GenericKeyedObjectPoolConfig.setMaxIdlePerKey(int)
    • setMaxTotal

      public void setMaxTotal(int maxTotal)
      Set the overall maximum number of objects that can exist in this pool.
      See Also:
      • GenericKeyedObjectPoolConfig.setMaxTotal(int)
    • setMaxTotalPerKey

      public void setMaxTotalPerKey(int maxTotalPerKey)
      Set the maximum number of objects that can exist in this pool for a given key.
      See Also:
      • GenericKeyedObjectPoolConfig.setMaxTotalPerKey(int)
    • setMinIdlePerKey

      public void setMinIdlePerKey(int minIdlePerKey)
      Set the minimum number of idle instances per key.
      See Also:
      • GenericKeyedObjectPoolConfig.setMinIdlePerKey(int)
    • setBlockWhenExhausted

      public void setBlockWhenExhausted(boolean blockWhenExhausted)
      Set whether to block when the pool is exhausted.
      See Also:
      • BaseObjectPoolConfig.setBlockWhenExhausted(boolean)
    • setEvictionPolicyClassName

      public void setEvictionPolicyClassName(String evictionPolicyClassName)
      Set the name of the eviction policy class.
      See Also:
      • BaseObjectPoolConfig.setEvictionPolicyClassName(String)
    • setFairness

      public void setFairness(boolean fairness)
      Set whether waiting threads are served as if waiting in a FIFO queue.
      See Also:
      • BaseObjectPoolConfig.setFairness(boolean)
    • setJmxEnabled

      public void setJmxEnabled(boolean jmxEnabled)
      Set whether JMX is enabled for this pool.
      See Also:
      • BaseObjectPoolConfig.setJmxEnabled(boolean)
    • setJmxNameBase

      public void setJmxNameBase(@Nullable String jmxNameBase)
      Set the base name to use for JMX naming.
      See Also:
      • BaseObjectPoolConfig.setJmxNameBase(String)
    • setJmxNamePrefix

      public void setJmxNamePrefix(String jmxNamePrefix)
      Set the JMX name prefix.
      See Also:
      • BaseObjectPoolConfig.setJmxNamePrefix(String)
    • setLifo

      public void setLifo(boolean lifo)
      Set whether the pool acts as a LIFO queue.
      See Also:
      • BaseObjectPoolConfig.setLifo(boolean)
    • setMaxWaitMillis

      public void setMaxWaitMillis(long maxWaitMillis)
      Set the maximum time to wait for an object to become available.
      See Also:
      • BaseObjectPoolConfig.setMaxWaitMillis(long)
    • setMinEvictableIdleTimeMillis

      public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
      Set the minimum time an object may sit idle before being eligible for eviction.
      See Also:
      • BaseObjectPoolConfig.setMinEvictableIdleTimeMillis(long)
    • setNumTestsPerEvictionRun

      public void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
      Set the number of objects to examine during each eviction run.
      See Also:
      • BaseObjectPoolConfig.setNumTestsPerEvictionRun(int)
    • 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:
      • BaseObjectPoolConfig.setSoftMinEvictableIdleTimeMillis(long)
    • setTestOnBorrow

      public void setTestOnBorrow(boolean testOnBorrow)
      Set whether objects are validated before being borrowed from the pool.
      See Also:
      • BaseObjectPoolConfig.setTestOnBorrow(boolean)
    • setTestOnCreate

      public void setTestOnCreate(boolean testOnCreate)
      Set whether objects are validated after creation.
      See Also:
      • BaseObjectPoolConfig.setTestOnCreate(boolean)
    • setTestOnReturn

      public void setTestOnReturn(boolean testOnReturn)
      Set whether objects are validated before being returned to the pool.
      See Also:
      • BaseObjectPoolConfig.setTestOnReturn(boolean)
    • setTestWhileIdle

      public void setTestWhileIdle(boolean testWhileIdle)
      Set whether idle objects are validated by the idle object evictor.
      See Also:
      • BaseObjectPoolConfig.setTestWhileIdle(boolean)
    • setTimeBetweenEvictionRunsMillis

      public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
      Set the time between runs of the idle object evictor.
      See Also:
      • BaseObjectPoolConfig.setTimeBetweenEvictionRunsMillis(long)
    • getMaxIdlePerKey

      public int getMaxIdlePerKey()
      Get the maximum number of idle instances per key.
      See Also:
      • GenericKeyedObjectPoolConfig.getMaxIdlePerKey()
    • getMaxTotal

      public int getMaxTotal()
      Get the overall maximum number of objects that can exist in this pool.
      See Also:
      • GenericKeyedObjectPoolConfig.getMaxTotal()
    • getMaxTotalPerKey

      public int getMaxTotalPerKey()
      Get the maximum number of objects that can exist in this pool for a given key.
      See Also:
      • GenericKeyedObjectPoolConfig.getMaxTotalPerKey()
    • getMinIdlePerKey

      public int getMinIdlePerKey()
      Get the minimum number of idle instances per key.
      See Also:
      • GenericKeyedObjectPoolConfig.getMinIdlePerKey()
    • isBlockWhenExhausted

      public boolean isBlockWhenExhausted()
      Return whether to block when the pool is exhausted.
      See Also:
      • BaseObjectPoolConfig.getBlockWhenExhausted()
    • getEvictionPolicyClassName

      public String getEvictionPolicyClassName()
      Get the name of the eviction policy class.
      See Also:
      • BaseObjectPoolConfig.getEvictionPolicyClassName()
    • isFairness

      public boolean isFairness()
      Return whether waiting threads are served as if waiting in a FIFO queue.
      See Also:
      • BaseObjectPoolConfig.getFairness()
    • isJmxEnabled

      public boolean isJmxEnabled()
      Return whether JMX is enabled for this pool.
      See Also:
      • BaseObjectPoolConfig.getJmxEnabled()
    • getJmxNameBase

      public @Nullable String getJmxNameBase()
      Get the base name to use for JMX naming.
      See Also:
      • BaseObjectPoolConfig.getJmxNameBase()
    • getJmxNamePrefix

      public String getJmxNamePrefix()
      Get the JMX name prefix.
      See Also:
      • BaseObjectPoolConfig.getJmxNamePrefix()
    • isLifo

      public boolean isLifo()
      Return whether the pool acts as a LIFO queue.
      See Also:
      • BaseObjectPoolConfig.getLifo()
    • getMaxWaitMillis

      public long getMaxWaitMillis()
      Get the maximum time to wait for an object to become available.
      See Also:
      • BaseObjectPoolConfig.getMaxWaitMillis()
    • getMinEvictableIdleTimeMillis

      public long getMinEvictableIdleTimeMillis()
      Get the minimum time an object may sit idle before being eligible for eviction.
      See Also:
      • BaseObjectPoolConfig.getMinEvictableIdleTimeMillis()
    • getNumTestsPerEvictionRun

      public int getNumTestsPerEvictionRun()
      Get the number of objects to examine during each eviction run.
      See Also:
      • BaseObjectPoolConfig.getNumTestsPerEvictionRun()
    • 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:
      • BaseObjectPoolConfig.getSoftMinEvictableIdleTimeMillis()
    • isTestOnBorrow

      public boolean isTestOnBorrow()
      Return whether objects are validated before being borrowed from the pool.
      See Also:
      • BaseObjectPoolConfig.getTestOnBorrow()
    • isTestOnCreate

      public boolean isTestOnCreate()
      Return whether objects are validated after creation.
      See Also:
      • BaseObjectPoolConfig.getTestOnCreate()
    • isTestOnReturn

      public boolean isTestOnReturn()
      Return whether objects are validated before being returned to the pool.
      See Also:
      • BaseObjectPoolConfig.getTestOnReturn()
    • isTestWhileIdle

      public boolean isTestWhileIdle()
      Return whether idle objects are validated by the idle object evictor.
      See Also:
      • BaseObjectPoolConfig.getTestWhileIdle()
    • getTimeBetweenEvictionRunsMillis

      public long getTimeBetweenEvictionRunsMillis()
      Get the time between runs of the idle object evictor.
      See Also:
      • BaseObjectPoolConfig.getTimeBetweenEvictionRunsMillis()