Class 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 Detail

      • BasePool

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

      • 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.