public abstract class AbstractRetryPolicy extends java.lang.Object implements RetryPolicy
RetryPolicy.isRetriable(int, long).| Modifier | Constructor and Description |
|---|---|
protected |
AbstractRetryPolicy(DelayPolicy delayPolicy)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getDelay(int numAttempts,
long lastDelay)
Gets the minimum amount of time that must elapse before the next retry
attempt.
|
java.lang.String |
toString()
Returns a human-readable description of this policy.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisRetriableprotected AbstractRetryPolicy(DelayPolicy delayPolicy)
delayPolicy - -
the policy that computes delays between retry attempts; must
be non-nullpublic long getDelay(int numAttempts,
long lastDelay)
getDelay in interface DelayPolicynumAttempts - -
the number of previous attempts (including first attempt and
retries); assumed to be >= 1lastDelay - -
the delay (in milliseconds) returned by the previous call to
this method (i.e., with numAttempts-1); -1 if
not previously code (i.e., when numAttempts==0public java.lang.String toString()
DelayPolicytoString in interface DelayPolicytoString in class java.lang.Object