|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.service.task.PendingTask
class PendingTask
Utility, package-private class for managing durable implementations of
Task that have been scheduled through the TaskService but
have not yet run to completion or been dropped. This class maintains all
of the meta-data associated with these pending tasks, and if needed, makes
sure that the Task itself is persisted. This meta-data classs
can be flagged as re-usable, so that a single instance can be persisted
and then re-used as needed, although a given instance must always be
re-used for tasks for the same Identity.
| Constructor Summary | |
|---|---|
PendingTask(Identity identity)
Creates an instance of PendingTask. |
|
| Method Summary | |
|---|---|
(package private) String |
getBaseTaskType()
Returns the type of the pending task. |
(package private) Identity |
getIdentity()
Returns the identity that owns this task. |
(package private) long |
getLastStartTime()
Returns the last time when this task actually started, or TaskServiceImpl.NEVER if the task has never been run. |
(package private) long |
getPeriod()
Returns the periodicity of this task, or TaskServiceImpl.PERIOD_NONE if the task is not periodic. |
(package private) long |
getRunningNode()
Returns the node where the associated task is running if the task is periodic, or -1 if the task is non-periodic or the node hasn't been assigned. |
(package private) long |
getStartTime()
Returns the time when this task is supposed to start, or TaskServiceImpl.START_NOW if the task is not delayed. |
(package private) boolean |
isPeriodic()
Checks if this is a periodic task. |
(package private) boolean |
isReusable()
Returns whether this PendingTask is free to be re-used. |
(package private) boolean |
isTaskAvailable()
Checks that the underlying task is available, which is only at question if the task was managed by the application and therefore could have been removed by the application. |
(package private) void |
resetValues(Task t,
long s,
long p)
Re-sets this PendingTask with the given values, and marks
it as unavailable. |
(package private) void |
run()
This is a convenience method used to correctly resolve the pending task and run it, throwing any exceptions raised by the task. |
(package private) void |
setLastStartTime(long lastStartTime)
Sets the last start time for this task. |
(package private) void |
setReusable()
Re-sets the task state so that the task can be re-used. |
(package private) void |
setRunningNode(long nodeId)
Sets the node where the associated task is running if the task is periodic. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
PendingTask(Identity identity)
PendingTask.
identity - the Identity of the owner of the task| Method Detail |
|---|
void resetValues(Task t,
long s,
long p)
PendingTask with the given values, and marks
it as unavailable. This can now be used to represent a durable
task that needs to be run. As described on TaskManager, any
Task may optionally implement ManagedObject and
this affects how the task is handled by the system. PendingTask
takes care of the task's durability, and how the task is eventually
run, in both situations.
t - the Task that is pendings - the starting time for the task, in milliseconds since
January 1, 1970, or TaskServiceImpl.START_NOWp - the period between recurrences, or
TaskServiceImpl.PERIOD_NONEboolean isReusable()
PendingTask is free to be re-used.
void setReusable()
String getBaseTaskType()
long getStartTime()
TaskServiceImpl.START_NOW if the task is not delayed.
long getPeriod()
TaskServiceImpl.PERIOD_NONE if the task is not periodic.
long getRunningNode()
long getLastStartTime()
TaskServiceImpl.NEVER if the task has never been run.
void setRunningNode(long nodeId)
IllegalStateException
is thrown.
void setLastStartTime(long lastStartTime)
lastStartTime - the new start timeboolean isPeriodic()
Identity getIdentity()
boolean isTaskAvailable()
void run() throws Exception
isTaskAvailable returns false then this
method will simply return without running anything.
Exception
|
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 | |||||||||