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 protectedBasePool(BasePoolConfig poolConfig)Create a new pool givenBasePoolConfig. -
Method Summary
Modifier and Type Method Description booleanisTestOnAcquire()Returns whether objects acquired from the pool will be validated before being returned from the acquire method.booleanisTestOnCreate()Returns whether objects created for the pool will be validated before being returned from the acquire method.booleanisTestOnRelease()Returns whether objects borrowed from the pool will be validated when they are returned to the pool via the release method.
-
Constructor Details
-
BasePool
Create a new pool givenBasePoolConfig.- Parameters:
poolConfig- must not benull.
-
-
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 theAsyncObjectFactory.validate(Object)method of the factory associated with the pool. If the object fails to validate, then acquire will fail.- Returns:
trueif 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 theAsyncObjectFactory.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:
trueif 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 theAsyncObjectFactory.validate(Object)method of the factory associated with the pool. Returning objects that fail validation are destroyed rather then being returned the pool.- Returns:
trueif objects are validated on return to the pool via the release method.
-