public class RetryTemplate extends Object
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_WAIT_TIME |
Constructor and Description |
---|
RetryTemplate(long waitTime,
Object notificationLock) |
RetryTemplate(Object notificationLock) |
Modifier and Type | Method and Description |
---|---|
protected void |
callbackFailed(long stop)
Template method invoked when the retry has failed.
|
protected void |
callbackSucceeded(long stop)
Template method invoked when the retry succeeded.
|
boolean |
equals(Object other) |
<T> T |
execute(RetryCallback<T> callback)
Main retry method.
|
long |
getWaitTime() |
int |
hashCode() |
protected void |
onMissingTarget()
Template method invoked if the backing service is missing.
|
void |
reset(long waitTime)
Reset the retry template, by applying the new values.
|
public static final long DEFAULT_WAIT_TIME
public RetryTemplate(long waitTime, Object notificationLock)
public RetryTemplate(Object notificationLock)
public <T> T execute(RetryCallback<T> callback)
#retryNumbers
while
waiting in-between for the DEFAULT_WAIT_TIME
amount.
Before bailing out, the callback will be called one more time. Thus, in
case of being unsuccessful, the default value of the callback is
returned.callback
- protected void onMissingTarget()
protected void callbackSucceeded(long stop)
stop
- the time it took to execute the call (including waiting for
the service)protected void callbackFailed(long stop)
stop
- the time it took to execute the call (including waiting for
the service)public void reset(long waitTime)
retriesNumber
- waitTime
- public long getWaitTime()
Copyright © 2006–2019. All rights reserved.