Packagecom.rosettastone.library.taskmanager
Classpublic class AbstractTaskManager
InheritanceAbstractTaskManager Inheritance Task Inheritance flash.events.EventDispatcher
Subclasses InterruptibleTaskManager, TaskManager

This is an abstract class and should not be instantiated directly. Instead use one of the following sub-classes: TaskManager, InterruptibleTaskManager



Public Properties
 PropertyDefined By
  completed : Boolean
[read-only] There are no pending or active Tasks.
AbstractTaskManager
 Inheriteddata : *
[read-only] Optional data parameter passed to the Task complete/error/interruption method.
Task
  errorDatas : Array
[read-only] Error datas from all inner Tasks that failed during execution.
AbstractTaskManager
  erroredTasks : Array
[read-only] Tasks that errored during execution.
AbstractTaskManager
  errorMessages : Array
[read-only] Unique error messages from all inner Tasks that failed during execution.
AbstractTaskManager
 Inheritedid : Number
[read-only]
Task
  interruptible : Boolean
[override] [read-only] The current Task can be interrupted.
AbstractTaskManager
 InheritedinterruptingTask : ITask
[read-only] The Task currently interrupting the composite Task's execution (or NULL if no such Task exists).
Task
 InheritedisComplete : Boolean
[read-only] The current task has successfully completed execution.
Task
 InheritedisErrored : Boolean
[read-only] The current task failed.
Task
 InheritedisInterrupted : Boolean
[read-only]
Task
 InheritedisRunning : Boolean
[read-only] The task is currently running.
Task
 Inheritedmessage : String
[read-only] Optional message parameter passed to the task complete/error/interruption method.
Task
  numCompletedTasks : int
[read-only] Number of Tasks that have successfully completed execution.
AbstractTaskManager
  numInternalOperations : int
[override] [read-only] Number of internal operations conducted by this task.
AbstractTaskManager
  numInternalOperationsCompleted : int
[override] [read-only] Number of internal operations that have completed.
AbstractTaskManager
 InheritednumInternalOperationsPending : int
[read-only] Number of internal operations not yet completed.
Task
  numTasks : int
[read-only] Number of Tasks to be executed by TaskManager.
AbstractTaskManager
 InheritednumTimesCompleted : int
[read-only] Number of times this task has completed.
Task
 InheritednumTimesErrored : int
[read-only] Number of times this task has errored.
Task
 InheritednumTimesInterrupted : int
[read-only] Number of times this task has been interrupted.
Task
 InheritednumTimesReset : int
[read-only] Number of times this task has been reset.
Task
 InheritednumTimesStarted : int
[read-only] Number of times this task has been started.
Task
 Inheritedrunning : Boolean
[read-only] The task is currently running.
Task
  synchronous : Boolean
[override] [read-only] The current task can be executed synchronously.
AbstractTaskManager
 InheritedtaskIdentifier : String
(Optional) human-readable label for task.
Task
 InheriteduniqueID : Number
[read-only] Unique ID for a task.
Task
Protected Properties
 PropertyDefined By
 Inheritedlogger : ILogger
[read-only] Instance of ILogger to be used for any custom Task logging.
Task
Public Methods
 MethodDefined By
 Inherited
and(... chainedTasks):ITask
Executes the specified tasks when the current task is executed.
Task
 Inherited
Task
  
interrupt():Boolean
[override] Interruptible tasks should override interrupt() and get interruptible() if they are interruptible.
AbstractTaskManager
 Inherited
interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified.
Task
 Inherited
or(... chainedTasks):ITask
Executes the specified tasks if the current task fails.
Task
 Inherited
reset():void
Resets the task to it's pre-run state.
Task
 Inherited
Starts a task.
Task
 Inherited
then(... chainedTasks):ITask
Executes the specified tasks once the current task has completed successfully.
Task
 Inherited
withCompleteHandler(completeHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate completion, this method may also be used for notification purposes.
Task
 Inherited
withErrorHandler(errorHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate failure, this method may also be used for notification purposes.
Task
 Inherited
withFinalHandler(finalHandler:Function):ITask
This handler is invoked upon either success or failure of the Task.
Task
 Inherited
withInterruptionHandler(interruptionHandler:Function):ITask
Task
 Inherited
withStartedHandler(startedHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate starting, this method may also be used for notification purposes.
Task
Protected Methods
 MethodDefined By
  
addTaskHelper(task:ITask, dependencies:Array = null):void
Adds a task to the graph and set its dependencies.
AbstractTaskManager
  
[override] Override this method to perform any custom reset operations.
AbstractTaskManager
  
customRun():void
[override] Override this method to give your Task functionality.
AbstractTaskManager
 Inherited
Task
 Inherited
getLoggerString(string:String):String
Returns a string for logging the specified task-state event.
Task
  
removeTaskHelper(taskToRemove:ITask):void
Removes a task from the task manager.
AbstractTaskManager
 Inherited
taskComplete(message:String, data:* = null):void
This method should be called upon Task completion.
Task
 Inherited
taskError(message:String, data:* = null):void
This method should be called upon Task failure.
Task
 Inherited
taskInterrupted(message:String, data:* = null):void
Call this method to interrupt the currently running Task.
Task
 Inherited
Task
Events
 Event Summary Defined By
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
 InheritedTask
  AbstractTaskManager
  AbstractTaskManager
  AbstractTaskManager
Property Detail
completedproperty
completed:Boolean  [read-only]

There are no pending or active Tasks.


Implementation
    public function get completed():Boolean
errorDatasproperty 
errorDatas:Array  [read-only]

Error datas from all inner Tasks that failed during execution.


Implementation
    public function get errorDatas():Array
erroredTasksproperty 
erroredTasks:Array  [read-only]

Tasks that errored during execution.


Implementation
    public function get erroredTasks():Array
errorMessagesproperty 
errorMessages:Array  [read-only]

Unique error messages from all inner Tasks that failed during execution.


Implementation
    public function get errorMessages():Array
interruptibleproperty 
interruptible:Boolean  [read-only] [override]

The current Task can be interrupted. Invoking interrupt() for a Task that is not marked as interruptible may result in an error.


Implementation
    public function get interruptible():Boolean
numCompletedTasksproperty 
numCompletedTasks:int  [read-only]

Number of Tasks that have successfully completed execution.


Implementation
    public function get numCompletedTasks():int
numInternalOperationsproperty 
numInternalOperations:int  [read-only] [override]

Number of internal operations conducted by this task. Sub-classes should override this method if containing a value > 1; If value > 1, task should dispatch ProgressEvent.PROGRESS events manually to indicate changes in numInternalOperationsCompleted. If value == 1, task will automatically dispatching ProgressEvent.PROGRESS events.


Implementation
    public function get numInternalOperations():int
numInternalOperationsCompletedproperty 
numInternalOperationsCompleted:int  [read-only] [override]

Number of internal operations that have completed. Sub-classes should override this method if containing a value > 1;


Implementation
    public function get numInternalOperationsCompleted():int
numTasksproperty 
numTasks:int  [read-only]

Number of Tasks to be executed by TaskManager.


Implementation
    public function get numTasks():int
synchronousproperty 
synchronous:Boolean  [read-only] [override]

The current task can be executed synchronously.


Implementation
    public function get synchronous():Boolean
Method Detail
addTaskHelper()method
protected function addTaskHelper(task:ITask, dependencies:Array = null):void

Adds a task to the graph and set its dependencies. If TaskManager is currently running and the specified Taks has invalid dependencies, an ERROR event will be dispatched immediately.

Parameters

task:ITask — Task to add to TaskManager
 
dependencies:Array (default = null) — Array of Tasks that newly added Task depends on


Throws
Error — if TaskManager has been configured for interruptible-mode and Task is not either interruptible or synchronous
customReset()method 
override protected function customReset():void

Override this method to perform any custom reset operations.

customRun()method 
override protected function customRun():void

Override this method to give your Task functionality.

interrupt()method 
override public function interrupt():Boolean

Interruptible tasks should override interrupt() and get interruptible() if they are interruptible. If they are, they should fire a TaskEvent.INTERRUPTED to indicate successful interruption of the task. If the interrupting fails at runtime, this method returns false

Returns
Boolean
removeTaskHelper()method 
protected function removeTaskHelper(taskToRemove:ITask):void

Removes a task from the task manager. If the TaskManager is running and this operation unblocks any of the remaining Tasks, they will be executed as a result of this removal.

Parameters

taskToRemove:ITask — The task to remove

Event Detail
taskManagerEventComplete Event
Event Object Type: com.rosettastone.library.taskmanager.events.TaskManagerEvent

taskManagerEventError Event  
Event Object Type: com.rosettastone.library.taskmanager.events.TaskManagerEvent

taskManagerEventInterrupted Event  
Event Object Type: com.rosettastone.library.taskmanager.events.TaskManagerEvent