@NotThreadSafe public class CountingRetry extends Object implements RetryPolicy
Constructor and Description |
---|
CountingRetry(int maxRetries)
Constructs a retry facility which allows max number of retries.
|
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.
|
void |
reset()
Reset the count of retries.
|
public CountingRetry(int maxRetries)
maxRetries
- max number of retriespublic int getAttemptCount()
RetryPolicy
getAttemptCount
in interface RetryPolicy
public boolean attempt()
RetryPolicy
attempt
in interface RetryPolicy
public void reset()
Copyright © 2023. All Rights Reserved.