Package io.lettuce.core.support
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 throughBasePoolConfig
.- Since:
- 5.1
- Author:
- Mark Paluch
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BasePool(BasePoolConfig poolConfig)
Create a new pool givenBasePoolConfig
.
-
Method Summary
All Methods Instance Methods Concrete Methods 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.
-
-
-
Constructor Detail
-
BasePool
protected BasePool(BasePoolConfig poolConfig)
Create a new pool givenBasePoolConfig
.- Parameters:
poolConfig
- must not benull
.
-
-
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 theAsyncObjectFactory.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 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:
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 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:
true
if objects are validated on return to the pool via the release method.
-
-