@NotThreadSafe public abstract class SleepingRetry extends Object implements RetryPolicy
Modifier | Constructor and Description |
---|---|
protected |
SleepingRetry(int maxRetries) |
Modifier and Type | Method and Description |
---|---|
boolean |
attempt()
Waits until it is time to perform the next retry, then returns.
|
int |
getAttemptCount()
How many retries have been performed.
|
protected abstract long |
getSleepTime()
How long to sleep before the next retry is performed.
|
protected TimeUnit |
getSleepUnit()
Unit of time that
getSleepTime() is measured in. |
public int getAttemptCount()
RetryPolicy
getAttemptCount
in interface RetryPolicy
public boolean attempt()
RetryPolicy
attempt
in interface RetryPolicy
protected TimeUnit getSleepUnit()
getSleepTime()
is measured in. Defaults to
TimeUnit.MILLISECONDS
.protected abstract long getSleepTime()
getSleepUnit()
, so all time given here must match the unit provided.Copyright © 2023. All Rights Reserved.