public class RetryNTimes extends java.lang.Object implements RetryPolicy
RetryPolicy.RetryPolicyFactory| Constructor and Description |
|---|
RetryNTimes(int maxAttemptCount) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowRetry()
Ask the policy if a retry is allowed.
|
void |
begin()
Operation is starting
|
RetryPolicy |
duplicate()
Duplicate this policy into a fresh instance
|
void |
failure(java.lang.Exception e)
Operation has failed
|
int |
getAttemptCount()
Return the number of attempts since begin was called
|
int |
getMaxAttemptCount() |
void |
success()
Operation has completed successfully
|
java.lang.String |
toString() |
public void begin()
RetryPolicybegin in interface RetryPolicypublic void success()
RetryPolicysuccess in interface RetryPolicypublic void failure(java.lang.Exception e)
RetryPolicyfailure in interface RetryPolicypublic boolean allowRetry()
RetryPolicyallowRetry in interface RetryPolicypublic int getAttemptCount()
RetryPolicygetAttemptCount in interface RetryPolicypublic int getMaxAttemptCount()
public RetryPolicy duplicate()
RetryPolicyduplicate in interface RetryPolicypublic java.lang.String toString()
toString in class java.lang.Object