public abstract class TimeBoundedRetry extends Object implements RetryPolicy
Constructor and Description |
---|
TimeBoundedRetry(TimeContext timeCtx,
java.time.Duration maxDuration) |
Modifier and Type | Method and Description |
---|---|
boolean |
attempt()
Waits until it is time to perform the next retry, then returns.
|
protected abstract java.time.Duration |
computeNextWaitTime() |
int |
getAttemptCount()
How many retries have been performed.
|
public TimeBoundedRetry(TimeContext timeCtx, java.time.Duration maxDuration)
timeCtx
- the time context to use for time-based operationsmaxDuration
- the maximum durationpublic int getAttemptCount()
RetryPolicy
getAttemptCount
in interface RetryPolicy
public boolean attempt()
RetryPolicy
attempt
in interface RetryPolicy
protected abstract java.time.Duration computeNextWaitTime()
Copyright © 2023. All Rights Reserved.