|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--edu.mssm.crover.ims.tasks.TaskStatus
TaskStatus is persistent and tracks the status of one task. See also the methods on the TaskManager that can alter the status of a task:
TaskManager.submit(Task),
TaskManager.requestTask(AbstractWorker),
TaskManager.failTask(Task,Exception),
TaskManager.completeTask(Task, TaskResult),
TaskManager.acceptTask(Task)| Field Summary | |
int |
ACCEPTED
|
int |
COMPLETED
|
int |
FAILED
|
int |
MAX_RESCHEDULE
|
int |
SCHEDULED
|
int |
STARTED
|
int |
TO_BE_SCHEDULED
|
| Constructor Summary | |
TaskStatus()
|
|
| Method Summary | |
void |
accept()
Call this when the task is accepted by a worker. |
void |
complete(TaskResult result)
|
void |
fail(java.lang.Exception e)
|
java.util.Date |
getAcceptationTime()
Returns the time when the last time the task was accepted by a worker. |
java.util.Date |
getCompletionTime()
Returns the time of completion. |
long |
getElapsedTime()
Returns the time elapsed since acceptation by a worker. |
java.util.Date |
getFailureTime()
Returns the time of failure. |
TaskResult |
getResult()
|
java.util.Date |
getSubmissionTime()
Returns the time of submission. |
protected void |
hasBeenRescheduled(Task task,
TaskManager tm)
|
boolean |
hasBeenSubmitted()
Returns true when the task has been submitted. |
boolean |
hasFailed()
|
boolean |
hasSucceeded()
|
boolean |
hasTimedOut()
|
boolean |
isReadyToStart()
|
void |
setReadyToStart()
|
void |
start()
|
void |
submit()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final int FAILED
public final int COMPLETED
public final int STARTED
public final int ACCEPTED
public final int SCHEDULED
public final int TO_BE_SCHEDULED
public int MAX_RESCHEDULE
| Constructor Detail |
public TaskStatus()
| Method Detail |
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean hasFailed()
public boolean hasTimedOut()
public boolean hasSucceeded()
public boolean hasBeenSubmitted()
public TaskResult getResult()
public void start()
throws IncorrectStateException
IncorrectStateException
public void accept()
throws IncorrectStateException
IncorrectStateException
public void fail(java.lang.Exception e)
throws IncorrectStateException
IncorrectStateException
public void complete(TaskResult result)
throws IncorrectStateException
IncorrectStateException
public void submit()
throws IncorrectStateException
IncorrectStateExceptionpublic java.util.Date getSubmissionTime()
public long getElapsedTime()
public java.util.Date getAcceptationTime()
public java.util.Date getCompletionTime()
public java.util.Date getFailureTime()
protected void hasBeenRescheduled(Task task,
TaskManager tm)
public boolean isReadyToStart()
public void setReadyToStart()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||