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, wait
isRetriable
protected 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 DelayPolicy
numAttempts
- -
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==0
public java.lang.String toString()
DelayPolicy
toString
in interface DelayPolicy
toString
in class java.lang.Object