Package io.lettuce.core.support
Class BasePoolConfig.Builder
- java.lang.Object
-
- io.lettuce.core.support.BasePoolConfig.Builder
-
- Direct Known Subclasses:
BoundedPoolConfig.Builder
- Enclosing class:
- BasePoolConfig
public abstract static class BasePoolConfig.Builder extends Object
Builder forBasePoolConfig
.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
testOnAcquire
protected boolean
testOnCreate
protected boolean
testOnRelease
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BasePoolConfig.Builder
testOnAcquire()
Enables validation of objects before being returned from the acquire method.BasePoolConfig.Builder
testOnAcquire(boolean testOnAcquire)
Configures whether objects acquired from the pool will be validated before being returned from the acquire method.BasePoolConfig.Builder
testOnCreate()
Enables validation of objects before being returned from the acquire method.BasePoolConfig.Builder
testOnCreate(boolean testOnCreate)
Configures whether objects created for the pool will be validated before being returned from the acquire method.BasePoolConfig.Builder
testOnRelease()
Enables validation of objects when they are returned to the pool via the release method.BasePoolConfig.Builder
testOnRelease(boolean testOnRelease)
Configures whether objects borrowed from the pool will be validated when they are returned to the pool via the release method.
-
-
-
Method Detail
-
testOnCreate
public BasePoolConfig.Builder testOnCreate()
Enables validation of objects 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:
this
BasePoolConfig.Builder
.
-
testOnCreate
public BasePoolConfig.Builder testOnCreate(boolean testOnCreate)
Configures 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.- Parameters:
testOnCreate
-true
if newly created objects should be validated before being returned from the acquire method.true
to enable test on creation.- Returns:
this
BasePoolConfig.Builder
.
-
testOnAcquire
public BasePoolConfig.Builder testOnAcquire()
Enables validation of objects 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:
this
BasePoolConfig.Builder
.
-
testOnAcquire
public BasePoolConfig.Builder testOnAcquire(boolean testOnAcquire)
Configures 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.- Parameters:
testOnAcquire
-true
if objects should be validated before being returned from the acquire method.- Returns:
this
BasePoolConfig.Builder
.
-
testOnRelease
public BasePoolConfig.Builder testOnRelease()
Enables validation of objects 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:
this
BasePoolConfig.Builder
.
-
testOnRelease
public BasePoolConfig.Builder testOnRelease(boolean testOnRelease)
Configures 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.- Parameters:
testOnRelease
-true
if objects should be validated on return to the pool via the release method.- Returns:
this
BasePoolConfig.Builder
.
-
-