|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--springs.util.retries.RetryingTask
A class that implements a retrying mechanism for tasks.
Field Summary | |
private boolean |
_aborted
|
private java.lang.Exception |
_lastException
|
protected long |
_millisAfterSleep
|
protected long |
_millisBetweenIterations
|
protected long |
_millisLastTry
|
protected long |
_millisLate
|
protected long |
_millisNextTry
|
protected long |
_millisTillNextTry
|
protected java.lang.Object |
_result
|
private springs.util.retries.RetryingStrategy |
_retryingStrategy
|
private boolean |
_success
|
private java.lang.String |
_taskDescription
|
private java.util.Timer |
_timer
|
long |
maxDelay
|
long |
minDelay
|
int |
numRetries
|
long |
totalDelay
Statistics |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
RetryingTask(springs.util.retries.RetryingStrategy retryingStrategy,
java.lang.String taskDescription)
Constructor. |
Method Summary | |
java.lang.Exception |
getException()
Gets the last exception produced.waitCompletion |
java.lang.Object |
getResult()
Gets the result. |
boolean |
getSuccess()
Checks if the task was performed successfully. |
void |
mainMethod()
Main method. |
void |
run()
Execution of the main method in background. |
void |
setResult(java.lang.Object result)
Sets the result. |
void |
task()
Performs the task. |
void |
waitCompletion()
Blocks until the task has been completed or the maximum number of retries has been reached. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private springs.util.retries.RetryingStrategy _retryingStrategy
private java.lang.String _taskDescription
private java.util.Timer _timer
private boolean _success
private boolean _aborted
private java.lang.Exception _lastException
protected java.lang.Object _result
public long totalDelay
public long maxDelay
public long minDelay
public int numRetries
protected long _millisLate
protected long _millisTillNextTry
protected long _millisLastTry
protected long _millisNextTry
protected long _millisBetweenIterations
protected long _millisAfterSleep
Constructor Detail |
public RetryingTask(springs.util.retries.RetryingStrategy retryingStrategy, java.lang.String taskDescription)
retryingStrategy
- the retrying strategy.RetryingStrategy
,
String
Method Detail |
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void mainMethod()
public void task() throws java.lang.Exception
java.lang.Exception
- if error.Exception
public java.lang.Exception getException()
Exception
public boolean getSuccess()
public void waitCompletion()
public java.lang.Object getResult()
Object
public void setResult(java.lang.Object result)
result
- the task's result.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |