This is an internal class used only by the
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
ImmediatelyInterruptable:Boolean [read-only]Implementation
public function get ImmediatelyInterruptable():Boolean
public var mState:TaskManagerItemStates
ScheduledTask:ITask [read-write]
Implementation
public function get ScheduledTask():ITask
public function set ScheduledTask(value:ITask):void
public function TaskManagerItem(aScheduledTask:ITask, aAccepting:Boolean)Parameters
| aScheduledTask:ITask |
| |
| aAccepting:Boolean |
public function acceptAllPreconditions():void
public function acceptPrecondition(aPrecondition:EventDescriptor):voidParameters
public function acceptPreconditionsByEventSource(aEventSource:IEventDispatcher):voidParameters
| aEventSource:IEventDispatcher |
public function addPrecondition(aPrecondition:EventDescriptor):voidParameters
public function dispose():void
public function ignoreAllPreconditions():void
public function ignorePrecondition(aPrecondition:EventDescriptor):voidParameters
public function ignorePreconditionsByEventSource(aEventSource:IEventDispatcher):voidParameters
| aEventSource:IEventDispatcher |
public function interrupt():void
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.
public function isImmediatelyInterruptable():Boolean
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.
Returns
public function isRunning():Boolean
TODO: Should be implemented.
Returns
public function removePrecondition(aPrecondition:EventDescriptor):voidParameters
public function removePreconditionsByEventSource(aEventSource:IEventDispatcher):voidParameters
| aEventSource:IEventDispatcher |
public function replacePreconditionsEventSource(aEventSource:IEventDispatcher, aNewEventSource:IEventDispatcher):voidParameters
| aEventSource:IEventDispatcher |
| |
| aNewEventSource:IEventDispatcher |
public function reset():void
See also
gugga.tasks.PreconditionsManager.reset()
public function start():void
Event object type: TaskEvent
Event object type: TaskEvent
Event object type: TaskEvent