Waiter.LogPointDEFAULT_INTERVAL| Constructor and Description |
|---|
SimpleWaiter(BooleanSupplier successCondition)
Construct new SimpleWaiter with a defined success condition.
|
SimpleWaiter(BooleanSupplier successCondition,
String reason)
Construct new SimpleWaiter with a defined success condition and a reason.
|
SimpleWaiter(BooleanSupplier successCondition,
TimeUnit timeoutUnit,
long timeout)
Construct new SimpleWaiter with a defined success condition and a timeout.
|
SimpleWaiter(BooleanSupplier successCondition,
TimeUnit timeoutUnit,
long timeout,
String reason)
Construct new SimpleWaiter with a defined success condition, reason, and a timeout.
|
| Modifier and Type | Method and Description |
|---|---|
SimpleWaiter |
failFast(FailFastCheck failFast)
Set the condition which will be evaluated before other conditions are checked.
|
SimpleWaiter |
failureCondition(BooleanSupplier failureCondition)
Set a failure condition.
|
SimpleWaiter |
interval(long millis)
Set the amount of time the wait will rest after checking all the conditions in the evaluation routine
|
SimpleWaiter |
interval(TimeUnit timeUnit,
long t)
Set the amount of time the wait will rest after checking all the conditions in the evaluation routine.
|
SimpleWaiter |
level(org.slf4j.event.Level level)
Set the log level of messages produced during this wait.
|
SimpleWaiter |
logPoint(Waiter.LogPoint logPoint)
Set XTF Waiter specific log configuration.
|
SimpleWaiter |
onFailure(Runnable runnable)
Set the
Runnable to be executed after the failureCondition has been met. |
SimpleWaiter |
onIteration(Runnable runnable)
Set the
Runnable to be executed upon each iteration of the evaluation cycle. |
SimpleWaiter |
onSuccess(Runnable runnable)
Set the
Runnable to be executed after the successCondition has been met. |
SimpleWaiter |
onTimeout(Runnable runnable)
Set a
Runnable to be executed upon timeout. |
SimpleWaiter |
reason(String reason)
Set the description of the reason why this wait is being performed.
|
SimpleWaiter |
timeout(long millis)
Set the maximum time windows in which the periodical evaluation of failure and success conditions will be done.
|
SimpleWaiter |
timeout(TimeUnit timeUnit,
long t)
Set the maximum time windows in which the periodical evaluation of failure and success conditions will be done.
|
boolean |
waitFor()
Waits for the success or a failure condition to be met or the timeout to occur.
|
public SimpleWaiter(BooleanSupplier successCondition)
waitFor().successCondition - whenever this supplier will provide true, waiting stops.public SimpleWaiter(BooleanSupplier successCondition, String reason)
waitFor().successCondition - whenever the provided condition will provide true, waiting stops.reason - description of the reason why this wait is being performedpublic SimpleWaiter(BooleanSupplier successCondition, TimeUnit timeoutUnit, long timeout)
waitFor().successCondition - whenever this supplier will provide true, waiting stops.timeoutUnit - unit of the timeouttimeout - maximum time window in which periodical condition evaluation will be donepublic SimpleWaiter(BooleanSupplier successCondition, TimeUnit timeoutUnit, long timeout, String reason)
waitFor().successCondition - whenever this supplier will provide true, waiting stops.timeoutUnit - unit of the timeouttimeout - maximum time window in which periodical condition evaluation will be donereason - description of the reason why this wait is being performed. Will be used in associated log
messages.public SimpleWaiter failureCondition(BooleanSupplier failureCondition)
failureCondition - whenever this supplier provides true, the wait will stop.SimpleWaiterpublic SimpleWaiter timeout(long millis)
timeout in interface Waitermillis - timeout in millisecondsSimpleWaiterpublic SimpleWaiter timeout(TimeUnit timeUnit, long t)
timeout in interface WaitertimeUnit - timeUnit that is converts time t to millisecondst - timeout in timeUnitSimpleWaiterpublic SimpleWaiter interval(long millis)
interval in interface Waitermillis - interval in millisecondsSimpleWaiterpublic SimpleWaiter interval(TimeUnit timeUnit, long t)
interval in interface WaitertimeUnit - timeUnit that is converts time t to millisecondst - interval in millisecondsSimpleWaiterpublic SimpleWaiter reason(String reason)
reason in interface Waiterreason - what the waiters what upon.SimpleWaiterpublic SimpleWaiter logPoint(Waiter.LogPoint logPoint)
Waiter.LogPoint allowing to specify whether the wait start, end, both events or none
of them should be logged.logPoint in interface WaiterlogPoint - what points of waiting should be logged.SimpleWaiterWaiter.LogPointpublic SimpleWaiter level(org.slf4j.event.Level level)
level in interface Waiterlevel - what level of severity should be used to log the message.SimpleWaiterLevelpublic SimpleWaiter onIteration(Runnable runnable)
Runnable to be executed upon each iteration of the evaluation cycle. This will be run after all
conditions were evaluated.onIteration in interface Waiterrunnable - code to be executed upon successful waiting.SimpleWaiterpublic SimpleWaiter onSuccess(Runnable runnable)
Runnable to be executed after the successCondition has been met.onSuccess in interface Waiterrunnable - code to be executed upon successful waiting.SimpleWaiterpublic SimpleWaiter onFailure(Runnable runnable)
Runnable to be executed after the failureCondition has been met.onFailure in interface Waiterrunnable - code to be executed upon successful waiting.SimpleWaiterpublic SimpleWaiter failFast(FailFastCheck failFast)
WaiterException. Note that non-blocking wait with exponential time backoff is used in
the evaluation routine for this check meaning that this condition will not be evaluated during each routine
cycle because the backoff time gradually increases while the interval is a constant.failFast in interface WaiterfailFast - returns true if waiting has failed.SimpleWaiterpublic SimpleWaiter onTimeout(Runnable runnable)
Runnable to be executed upon timeout. This will be executed as a last thing outside the evaluation
routine before the WaiterException is thrown.onTimeout in interface Waiterrunnable - code to be executed upon timed out waiting.SimpleWaiterpublic boolean waitFor()
waitFor in interface WaiterWaiterException - if the timeout occurs, the blocking wait thread is interrupted or a fast fail check is
evaluated to true.Copyright © 2025. All rights reserved.