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