public interface RetryTimeout extends Retryable
RetryTimeout
can be used in loops to test whether a timeout has
been reached, if the timeout has not been reached, then a given period of
time (delay) is waited. In case no more timeout is "left" the business logic
may act accordingly such as throwing an exception.
The actual timeout being waited is the effective time elapsed from the first
call to Retryable.nextRetry()
till the last call to Retryable.nextRetry()
. Any
delay inside the iteration loop is not added up to the delay.
Modifier and Type | Method and Description |
---|---|
long |
getRetryDelayInMs()
Returns retry to wait in milliseconds upon calling
Retryable.nextRetry() ). |
long |
getTimeoutInMs()
Returns the timeout altogether the
RetryTimeout is waiting while
iterating through the RetryTimeout via Retryable.hasNextRetry()
and Retryable.nextRetry() . |
boolean |
nextRetry(Object aMonitor)
Tests whether a next retry is possible.
|
getRetryCount, hasNextRetry, nextRetry
boolean nextRetry(Object aMonitor)
#notify()
or
#notifyAll()
. Similar to the Retryable.nextRetry()
with the
difference of accepting a dedicated monitor which is used for aborting
the dellay.Retryable.hasNextRetry()
.long getTimeoutInMs()
RetryTimeout
is waiting while
iterating through the RetryTimeout
via Retryable.hasNextRetry()
and Retryable.nextRetry()
. The actual timeout being waited is the
effective time elapsed from the first call to Retryable.nextRetry()
till
the last call to Retryable.nextRetry()
. Any delay inside the iteration
loop is not added up to the delay.long getRetryDelayInMs()
Retryable.nextRetry()
).Copyright © 2017. All rights reserved.