public abstract class SleepingRetry extends Object implements RetryPolicy
Modifier | Constructor and Description |
---|---|
protected |
SleepingRetry(int maxRetries) |
Modifier and Type | Method and Description |
---|---|
boolean |
attemptRetry()
Attempts to run the given operation, returning false if unable to (max retries have happened).
|
int |
getRetryCount()
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 getRetryCount()
RetryPolicy
getRetryCount
in interface RetryPolicy
public boolean attemptRetry()
RetryPolicy
attemptRetry
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 © 2015. All Rights Reserved.