|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.app.profile.ProfileTaskManager
public class ProfileTaskManager
This is implementation of TaskManager simply calls its backing
manager for each manager method.
| Constructor Summary | |
|---|---|
ProfileTaskManager(TaskManager backingManager)
Creates an instance of ProfileTaskManager. |
|
| Method Summary | |
|---|---|
PeriodicTaskHandle |
schedulePeriodicTask(Task task,
long delay,
long period)
Schedules a task to run periodically after a delay. |
void |
scheduleTask(Task task)
Schedules a task to run now. |
void |
scheduleTask(Task task,
long delay)
Schedules a task to run after a delay. |
boolean |
shouldContinue()
Returns true if the currently running task should do more work
if it is available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProfileTaskManager(TaskManager backingManager)
ProfileTaskManager.
backingManager - the TaskManager to call through to| Method Detail |
|---|
public void scheduleTask(Task task)
TaskManager will call the
task's run method as soon as possible after the
completion of the task in which this method is called, according to its
scheduling algorithm.
If the call to the run method throws an exception, that
exception implements ExceptionRetryStatus, and its shouldRetry method returns
true, then the TaskManager will make further
attempts to run the task. It will continue those attempts until either
an attempt succeeds or it notices an exception is thrown that is not
retryable. The TaskManager is permitted to treat a
non-retryable exception as a hint. In particular, a task that throws a
non-retryable exception may be retried if the node running the task
crashes.
scheduleTask in interface TaskManagertask - the task to run
public void scheduleTask(Task task,
long delay)
TaskManager
will wait for the specified number of milliseconds, and then call the
task's run method as soon as possible after the
completion of the task in which this method is called, according to its
scheduling algorithm.
If the call to the run method throws an exception, that
exception implements ExceptionRetryStatus, and its shouldRetry method returns
true, then the TaskManager will make further
attempts to run the task. It will continue those attempts until either
an attempt succeeds or it notices an exception is thrown that is not
retryable. The TaskManager is permitted to treat a
non-retryable exception as a hint. In particular, a task that throws a
non-retryable exception may be retried if the node running the task
crashes.
scheduleTask in interface TaskManagertask - the task to rundelay - the number of milliseconds to delay before running the
task
public PeriodicTaskHandle schedulePeriodicTask(Task task,
long delay,
long period)
TaskManager will wait for the specified number of
milliseconds, and then call the task's run method as
soon as possible after the completion of the task in which this method
is called, according to its scheduling algorithm. It will also arrange
to run the task periodically at the specified interval following the
delay until the PeriodicTaskHandle.cancel method is called on the associated handle.
At the start of each period, which occurs period
milliseconds after the scheduled start of the previous period, a new
task will be scheduled to run. The TaskManager will make
a best effort to run a new task in each period, but even if the task
cannot be run in one period, a new task will always be scheduled for
the following period. The TaskManager will wait until
the current attempt to run the task has ended before making another
attempt to run it, regardless of whether the attempts are for the same
or different periods.
If the call to the run method throws an exception, that
exception implements ExceptionRetryStatus, and its shouldRetry method returns
true, then the TaskManager will make further
attempts to run the task. It will continue those attempts until either
an attempt succeeds or it notices an exception is thrown that is not
retryable. Note that calls to PeriodicTaskHandle.cancel
have no effect on attempts to retry a task after the first attempt. The
TaskManager is permitted to treat a non-retryable exception
as a hint. In particular, a task that throws a non-retryable exception
may be retried if the node running the task crashes.
schedulePeriodicTask in interface TaskManagertask - the task to rundelay - the number of milliseconds to delay before running the
taskperiod - the number of milliseconds that should elapse between
the starts of periodic attempts to run the task
public boolean shouldContinue()
true if the currently running task should do more work
if it is available. Otherwise, returns false. This method
should always return true until the current task has done enough
work such that the work required to reschedule the task is negligible in
comparison to the work already done.
shouldContinue in interface TaskManagertrue if the currently running task should do more work
if possible; otherwise false
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||