Package org.ldaptive
Class PooledConnectionFactory.RetryValidationExceptionHandler
- java.lang.Object
-
- org.ldaptive.PooledConnectionFactory.RetryValidationExceptionHandler
-
- All Implemented Interfaces:
Function<ValidationException,Connection>
,ValidationExceptionHandler
- Enclosing class:
- PooledConnectionFactory
public class PooledConnectionFactory.RetryValidationExceptionHandler extends Object implements ValidationExceptionHandler
Validation exception handler that attempts to retrieve another connection. By default, this implementation makesAbstractConnectionPool.getMaxPoolSize()
attempts or waitsBlockingConnectionPool.getBlockWaitTime()
whichever occurs first.
-
-
Field Summary
Fields Modifier and Type Field Description private BiPredicate<Integer,Instant>
continueCondition
Condition on which to continue retry.
-
Constructor Summary
Constructors Constructor Description RetryValidationExceptionHandler()
Creates a new retry validation exception handler.RetryValidationExceptionHandler(BiPredicate<Integer,Instant> condition)
Creates a new retry validation exception handler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Connection
apply(ValidationException e)
-
-
-
Field Detail
-
continueCondition
private final BiPredicate<Integer,Instant> continueCondition
Condition on which to continue retry. First parameter is the count, the second is the time the retry started.
-
-
Constructor Detail
-
RetryValidationExceptionHandler
public RetryValidationExceptionHandler()
Creates a new retry validation exception handler.
-
RetryValidationExceptionHandler
public RetryValidationExceptionHandler(BiPredicate<Integer,Instant> condition)
Creates a new retry validation exception handler.- Parameters:
condition
- on which to retry
-
-
Method Detail
-
apply
public Connection apply(ValidationException e)
- Specified by:
apply
in interfaceFunction<ValidationException,Connection>
-
-