Package org.refcodes.controlflow
Interface Retryable
-
- All Superinterfaces:
org.refcodes.mixin.Abortable
,org.refcodes.mixin.Restartable
- All Known Subinterfaces:
RetryCounter
,RetryTimeout
- All Known Implementing Classes:
RetryCounterImpl
,RetryTimeoutImpl
public interface Retryable extends org.refcodes.mixin.Restartable, org.refcodes.mixin.Abortable
TheRetryable
provides methods for performing various retry iterations, be it based on retry counts or retry timeouts.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getRetryCount()
The current state regarding the retires.boolean
hasNextRetry()
Returns true in case not all retires have been used up.boolean
nextRetry()
Tests whether a next retry is possible.
-
-
-
Method Detail
-
nextRetry
boolean nextRetry()
Tests whether a next retry is possible. In case this is the case, then the thread is delayed by the configured (implementation specific) delay time.- Returns:
- True in case there is a next retry as of
hasNextRetry()
.
-
hasNextRetry
boolean hasNextRetry()
Returns true in case not all retires have been used up.- Returns:
- True in case there are retries left true in case all retries elapsed.
-
getRetryCount
int getRetryCount()
The current state regarding the retires. It specifies at which retry we currently are.- Returns:
- The number of retries used up so far.
-
-