![]() | ![]() |


TaskManager class. TaskManagerItem is a task, composed by two tasks: PreconditionsTask encapsulating all preconditions needed for starting the scheduled task ScheduledTask an arbitrary task that will start, only if all preconditions are met, and the PreconditionsTask is completed
Definition at line 24 of file TaskManagerItem.as.
Public Member Functions | |
| function get | ScheduledTask () |
| function set | ScheduledTask (aValue:ITask) |
| function get | ImmediatelyInterruptable () |
| function | TaskManagerItem (aScheduledTask:ITask, aAccepting:Boolean) |
| function | addPrecondition (aPrecondition:EventDescriptor) |
| function | removePrecondition (aPrecondition:EventDescriptor) |
| function | removePreconditionsByEventSource (aEventSource:IEventDispatcher) |
| function | replacePreconditionsEventSource (aEventSource:IEventDispatcher, aNewEventSource:IEventDispatcher) |
| function | acceptPrecondition (aPrecondition:EventDescriptor) |
| function | acceptPreconditionsByEventSource (aEventSource:IEventDispatcher) |
| function | acceptAllPreconditions () |
| function | ignorePrecondition (aPrecondition:EventDescriptor) |
| function | ignorePreconditionsByEventSource (aEventSource:IEventDispatcher) |
| function | ignoreAllPreconditions () |
| function | reset () |
| function | start () |
| function | isRunning () |
| function | isImmediatelyInterruptable () |
| function | interrupt () |
| function | dispose () |
Private Member Functions | |
| function | changeToInterruptedState () |
| function | onPreconditionsMet (ev) |
| function | onScheduledTaskCompleted (ev) |
| function | onScheduledTaskInterrupted (ev) |
Private Attributes | |
| var | mScheduledTask: ITask |
| var | mPreconditions: PreconditionsTask |
| var | mState: TaskManagerItemStates |
| var | mScheduledTaskCompletedListener: Listener |
| function gugga.sequence.TaskManagerItem.TaskManagerItem | ( | aScheduledTask:ITask | , | |
| aAccepting:Boolean | ||||
| ) |
Definition at line 59 of file TaskManagerItem.as.
| function get gugga.sequence.TaskManagerItem.ScheduledTask | ( | ) |
Definition at line 33 of file TaskManagerItem.as.
| function set gugga.sequence.TaskManagerItem.ScheduledTask | ( | aValue:ITask | ) |
Definition at line 38 of file TaskManagerItem.as.
| function get gugga.sequence.TaskManagerItem.ImmediatelyInterruptable | ( | ) |
Definition at line 54 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.addPrecondition | ( | aPrecondition:EventDescriptor | ) |
Definition at line 78 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.removePrecondition | ( | aPrecondition:EventDescriptor | ) |
Definition at line 83 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.removePreconditionsByEventSource | ( | aEventSource:IEventDispatcher | ) |
Definition at line 88 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.replacePreconditionsEventSource | ( | aEventSource:IEventDispatcher | , | |
| aNewEventSource:IEventDispatcher | ||||
| ) |
Definition at line 93 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.acceptPrecondition | ( | aPrecondition:EventDescriptor | ) |
Definition at line 100 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.acceptPreconditionsByEventSource | ( | aEventSource:IEventDispatcher | ) |
Definition at line 105 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.acceptAllPreconditions | ( | ) |
Definition at line 110 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.ignorePrecondition | ( | aPrecondition:EventDescriptor | ) |
Definition at line 115 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.ignorePreconditionsByEventSource | ( | aEventSource:IEventDispatcher | ) |
Definition at line 120 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.ignoreAllPreconditions | ( | ) |
Definition at line 125 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.reset | ( | ) |
Definition at line 133 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.start | ( | ) |
Definition at line 140 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.isRunning | ( | ) |
TODO: Should be implemented.
Definition at line 153 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.isImmediatelyInterruptable | ( | ) |
isImmediatelyInterruptable() always returns true when TaskManagerItem is not in TaskManagerItemStates.Running state. When TaskManagerItem is in TaskManagerItemStates.Running state, isImmediatelyInterruptable() returns true only if the scheduled task is immediately interruptable.
Definition at line 165 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.interrupt | ( | ) |
TODO: Should examine case when changing ScheduledTask while interrupting
interrupt() will check whether the TaskManagerItem state is TaskManagerItemStates.Running.
If in running state, it will check whether the scheduled task is isImmediatelyInterruptable and if it isn't, it will create a listener which is subscribed to the interrupted event of the scheduled task - the TaskManagerItem will be interrupted right after this event is caught and consumed. If the scheduled task is isImmediatelyInterruptable it will be directly interrupted, and right after it, the TaskManagerItem will be also interrupted.
If not in running state, it will interrupt the preconditions task, before putting TaskManagerItem in interrupted state.
Definition at line 193 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.dispose | ( | ) |
Definition at line 218 of file TaskManagerItem.as.
| function gugga.sequence.TaskManagerItem.changeToInterruptedState | ( | ) | [private] |
Definition at line 224 of file TaskManagerItem.as.
References gugga.events.EventDispatcher.dispatchEvent().
Here is the call graph for this function:

| function gugga.sequence.TaskManagerItem.onPreconditionsMet | ( | ev | ) | [private] |
Definition at line 230 of file TaskManagerItem.as.
References gugga.events.EventDispatcher.dispatchEvent().
Here is the call graph for this function:

| function gugga.sequence.TaskManagerItem.onScheduledTaskCompleted | ( | ev | ) | [private] |
Definition at line 240 of file TaskManagerItem.as.
References gugga.events.EventDispatcher.dispatchEvent().
Here is the call graph for this function:

| function gugga.sequence.TaskManagerItem.onScheduledTaskInterrupted | ( | ev | ) | [private] |
Definition at line 246 of file TaskManagerItem.as.
var gugga.sequence.TaskManagerItem.mScheduledTask [private] |
Definition at line 28 of file TaskManagerItem.as.
var gugga.sequence.TaskManagerItem.mPreconditions [private] |
Definition at line 29 of file TaskManagerItem.as.
var gugga.sequence.TaskManagerItem.mState [private] |
Definition at line 30 of file TaskManagerItem.as.
Definition at line 31 of file TaskManagerItem.as.
1.5.2