Module lettuce.core

Class BasePool

java.lang.Object
io.lettuce.core.support.BasePool
Direct Known Subclasses:
BoundedAsyncPool

public abstract class BasePool
extends Object
Basic implementation of a pool configured through BasePoolConfig.
Since:
5.1
Author:
Mark Paluch
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    protected BasePool​(BasePoolConfig poolConfig)
    Create a new pool given BasePoolConfig.
  • Method Summary

    Modifier and Type Method Description
    boolean isTestOnAcquire()
    Returns whether objects acquired from the pool will be validated before being returned from the acquire method.
    boolean isTestOnCreate()
    Returns whether objects created for the pool will be validated before being returned from the acquire method.
    boolean isTestOnRelease()
    Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the release method.

    Methods inherited from class java.lang.Object

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

    • BasePool

      protected BasePool​(BasePoolConfig poolConfig)
      Create a new pool given BasePoolConfig.
      Parameters:
      poolConfig - must not be null.
  • Method Details

    • isTestOnCreate

      public boolean isTestOnCreate()
      Returns whether objects created for the pool will be validated before being returned from the acquire method. Validation is performed by the AsyncObjectFactory.validate(Object) method of the factory associated with the pool. If the object fails to validate, then acquire will fail.
      Returns:
      true if newly created objects are validated before being returned from the acquire method.
    • isTestOnAcquire

      public boolean isTestOnAcquire()
      Returns whether objects acquired from the pool will be validated before being returned from the acquire method. Validation is performed by the AsyncObjectFactory.validate(Object) method of the factory associated with the pool. If the object fails to validate, it will be removed from the pool and destroyed, and a new attempt will be made to borrow an object from the pool.
      Returns:
      true if objects are validated before being returned from the acquire method.
    • isTestOnRelease

      public boolean isTestOnRelease()
      Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the release method. Validation is performed by the AsyncObjectFactory.validate(Object) method of the factory associated with the pool. Returning objects that fail validation are destroyed rather then being returned the pool.
      Returns:
      true if objects are validated on return to the pool via the release method.