|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gemini.blueprint.service.importer.support.internal.support.RetryTemplate
public class RetryTemplate
Wrapper retry template. This class does specialized retries using a given callback and lock.
Field Summary | |
---|---|
static long |
DEFAULT_WAIT_TIME
|
Constructor Summary | |
---|---|
RetryTemplate(long waitTime,
Object notificationLock)
|
|
RetryTemplate(Object notificationLock)
|
Method Summary | ||
---|---|---|
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)
|
|
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final long DEFAULT_WAIT_TIME
Constructor Detail |
---|
public RetryTemplate(long waitTime, Object notificationLock)
public RetryTemplate(Object notificationLock)
Method Detail |
---|
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()
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |