public class RetryCounter extends Object
Constructor and Description |
---|
RetryCounter(int maxRetries,
int retryInterval,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
int |
getAttemptTimes() |
int |
getMaxRetries() |
void |
resetAttemptTimes() |
boolean |
shouldRetry() |
boolean |
shouldRetryInnerMinutes() |
void |
sleepUntilNextRetry()
Sleep for a exponentially back off time
|
void |
useRetry() |
public RetryCounter(int maxRetries, int retryInterval, TimeUnit timeUnit)
public int getMaxRetries()
public void sleepUntilNextRetry() throws InterruptedException
InterruptedException
public boolean shouldRetry()
public void useRetry()
public int getAttemptTimes()
public void resetAttemptTimes()
public boolean shouldRetryInnerMinutes()
Copyright © 2020. All rights reserved.