|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jini.thread.RetryTask
public abstract class RetryTask
| Field Summary |
|---|
| Fields inherited from interface com.sun.jini.constants.TimeConstants |
|---|
DAYS, HOURS, MINUTES, SECONDS |
| Constructor Summary | |
|---|---|
RetryTask(TaskManager manager,
WakeupManager wakeupManager)
Create a new RetryTask that will be scheduled with
the given task manager, and which will perform retry scheduling
using the given wakeup manager. |
|
| Method Summary | |
|---|---|
int |
attempt()
Return the attempt number, starting with zero. |
void |
cancel()
Cancel the retrying of the task. |
boolean |
cancelled()
Return true if cancel has been invoked. |
boolean |
complete()
Return true if tryOnce has returned
successfully. |
void |
reset()
Reset values for a new use of this task. |
long |
retryTime()
Return the next time at which we should make another attempt. |
void |
run()
The run method used as a
TaskManager.Task. |
long |
startTime()
Return the time this task was created, or the last time reset was called. |
abstract boolean |
tryOnce()
Make a single attempt. |
boolean |
waitFor()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.jini.thread.TaskManager.Task |
|---|
runAfter |
| Constructor Detail |
|---|
public RetryTask(TaskManager manager,
WakeupManager wakeupManager)
RetryTask that will be scheduled with
the given task manager, and which will perform retry scheduling
using the given wakeup manager.
| Method Detail |
|---|
public abstract boolean tryOnce()
true if the attempt
was successful. If the attempt is not successful, the task
will be scheduled for a future retry.
public void run()
run method used as a
TaskManager.Task. This invokes
tryOnce. If it is not successful, it schedules
the task for a future retry at the time it gets by invoking
retryTime.
run in interface RunnabletryOnce(),
startTimepublic long retryTime()
The implementation is free to do as it pleases with the policy here. The default implementation is to delay using intervals of 1 second, 5 seconds, 10 seconds, 1 minute, and 1 minute between attempts, and then retrying every five minutes forever.
The default implementation assumes it is being called from
the default run method and that the current thread
holds the lock on this object. If the caller does
not own the lock the result is undefined and could result in an
exception.
public long startTime()
reset was called.
public int attempt()
public void cancel()
tryOnce. It will not
interfere with any ongoing invocation of tryOnce
unless a subclass overrides this to do so. Any override of this
method should invoke super.cancel().
public boolean cancelled()
true if cancel has been invoked.
public boolean complete()
true if tryOnce has returned
successfully.
public boolean waitFor()
throws InterruptedException
InterruptedExceptionpublic void reset()
|
GigaSpaces XAP 10.1 API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||