|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectguarana.toolkit.engine.WorkUnit
public class WorkUnit
Represents a wrapper for tasks that can be executed. Work units have, apart of the task to be execute, the date and time it must be executed.
Constructor Summary | |
---|---|
WorkUnit(Task task)
Creates a work unit for a given Task which can be processed instantaneously. |
|
WorkUnit(Task task,
long notBefore)
Creates a work unit for a given Task which must be processed on the specified date or latter. |
Method Summary | |
---|---|
int |
compareTo(WorkUnit workUnit)
Compares the current work unit with another one. |
void |
execute()
Executes the wrapped task by this object and if the task is a trigger task, computes the next execution time. |
long |
getDateToExecute()
Return the date on which this work unit can be processed. |
Task |
getTask()
Returns the task assigned to be processed by this work unit. |
boolean |
isTrigger()
Checks if this object contains a trigger task. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkUnit(Task task, long notBefore)
Task
which must be processed on the specified date or latter.
task
- The Task
which can be processed.notBefore
- The date on which this work unit can be processed.public WorkUnit(Task task)
Task
which can be processed instantaneously.
task
- the Task
which can be processed.Method Detail |
---|
public int compareTo(WorkUnit workUnit)
compareTo
in interface Comparable<WorkUnit>
workUnit
- The work unit to compare with this one.
public boolean isTrigger()
public void execute() throws TaskExecutionException
TaskExecutionException
- throws any exception caused by the task execute() method.Task
,
TaskExecutionException
public Task getTask()
public long getDateToExecute()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |