| Package | com.rosettastone.library.taskmanager |
| Class | public class AbstractCompositeTask |
| Inheritance | AbstractCompositeTask Task flash.events.EventDispatcher |
| Subclasses | CompositeTask, InterruptibleCompositeTask |
| Property | Defined By | ||
|---|---|---|---|
![]() | data : * [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. | AbstractCompositeTask | ||
| erroredTasks : Array [read-only]
Tasks that errored during execution. | AbstractCompositeTask | ||
| errorMessages : Array [read-only]
Unique error messages from all inner Tasks that failed during execution. | AbstractCompositeTask | ||
![]() | id : Number [read-only]
| Task | |
| interruptible : Boolean [override] [read-only]
The current Task can be interrupted. | AbstractCompositeTask | ||
![]() | interruptingTask : ITask [read-only]
The Task currently interrupting the composite Task's execution (or NULL if no such Task exists). | Task | |
![]() | isComplete : Boolean [read-only]
The current task has successfully completed execution. | Task | |
![]() | isErrored : Boolean [read-only]
The current task failed. | Task | |
![]() | isInterrupted : Boolean [read-only]
| Task | |
![]() | isRunning : Boolean [read-only]
The task is currently running. | Task | |
![]() | message : String [read-only]
Optional message parameter passed to the task complete/error/interruption method. | Task | |
| numCompletedTasks : int [read-only]
Number of inner Tasks that have successfully completed. | AbstractCompositeTask | ||
| numInternalOperations : int [override] [read-only]
Number of internal operations conducted by this task. | AbstractCompositeTask | ||
| numInternalOperationsCompleted : int [override] [read-only]
Number of internal operations that have completed. | AbstractCompositeTask | ||
![]() | numInternalOperationsPending : int [read-only]
Number of internal operations not yet completed. | Task | |
| numPendingTasks : int [read-only]
Number of inner Tasks that have been started and have not yet completed. | AbstractCompositeTask | ||
| numTasks : int [read-only]
Number of inner Tasks. | AbstractCompositeTask | ||
![]() | numTimesCompleted : int [read-only]
Number of times this task has completed. | Task | |
![]() | numTimesErrored : int [read-only]
Number of times this task has errored. | Task | |
![]() | numTimesInterrupted : int [read-only]
Number of times this task has been interrupted. | Task | |
![]() | numTimesReset : int [read-only]
Number of times this task has been reset. | Task | |
![]() | numTimesStarted : int [read-only]
Number of times this task has been started. | Task | |
| pendingTasks : Array [read-only]
Tasks currently in the process of being executed. | AbstractCompositeTask | ||
![]() | running : Boolean [read-only]
The task is currently running. | Task | |
| synchronous : Boolean [override] [read-only]
The current task can be executed synchronously. | AbstractCompositeTask | ||
![]() | taskIdentifier : String
(Optional) human-readable label for task. | Task | |
![]() | uniqueID : Number [read-only]
Unique ID for a task. | Task | |
| Property | Defined By | ||
|---|---|---|---|
| _addTasksBeforeRunInvoked : Boolean | AbstractCompositeTask | ||
| allTasksAreCompleted : Boolean [read-only]
No incomplete Tasks remain in the queue. | AbstractCompositeTask | ||
| currentSerialTask : ITask [read-only]
References the Task that is currently running (if this CompositeTask has been told to execute in serial). | AbstractCompositeTask | ||
| _erroredTasks : Array | AbstractCompositeTask | ||
| _executeTaskInParallel : Boolean | AbstractCompositeTask | ||
| _flushTaskQueueLock : Boolean | AbstractCompositeTask | ||
| _interruptedTask : ITask | AbstractCompositeTask | ||
![]() | logger : ILogger [read-only]
Instance of ILogger to be used for any custom Task logging. | Task | |
| _taskQueue : Array | AbstractCompositeTask | ||
| _taskQueueIndex : int | AbstractCompositeTask | ||
| Method | Defined By | ||
|---|---|---|---|
addFunction(closure:Function, closureIdentifier:String = null):TaskWithClosure
Adds a function to the queue of Tasks by wrapping it inside of a TaskWithClosure. | AbstractCompositeTask | ||
addMultiple(... tasksOrFunctions):void
Adds multiple Tasks or Functions to the internal set. | AbstractCompositeTask | ||
![]() |
Executes the specified tasks when the current task is executed. | Task | |
![]() | Task | ||
interrupt():Boolean [override]
Interruptible tasks should override interrupt() and get interruptible() if they are interruptible. | AbstractCompositeTask | ||
![]() | interruptForTask(interruptingTask:ITask):Boolean
Interrupts the current Task to wait on the Task specified. | Task | |
![]() |
Executes the specified tasks if the current task fails. | Task | |
removeFunction(closure:Function):TaskWithClosure
Removes a function from the queue of Tasks by locating its corresponding TaskWithClosure. | AbstractCompositeTask | ||
removeMultiple(... tasksOrFunctions):void
Removes multiple Tasks or Functions from the internal set. | AbstractCompositeTask | ||
removeTask(task:ITask):void
Removes a task from the internal set that this class will execute. | AbstractCompositeTask | ||
![]() | reset():void
Resets the task to it's pre-run state. | Task | |
![]() |
Starts a task. | Task | |
![]() |
Executes the specified tasks once the current task has completed successfully. | Task | |
![]() | withCompleteHandler(completeHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate completion, this method may also be used for notification purposes. | Task | |
![]() | withErrorHandler(errorHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate failure, this method may also be used for notification purposes. | Task | |
![]() | withFinalHandler(finalHandler:Function):ITask
This handler is invoked upon either success or failure of the Task. | Task | |
![]() | withInterruptionHandler(interruptionHandler:Function):ITask | Task | |
![]() | withStartedHandler(startedHandler:Function):ITask
Although tasks dispatch TaskEvents to indicate starting, this method may also be used for notification purposes. | Task | |
| Method | Defined By | ||
|---|---|---|---|
addTaskEventListeners(task:ITask):void
Convenience method for adding TaskEvent listeners to a Task. | AbstractCompositeTask | ||
addTaskHelper(task:ITask):void
Adds another task to the internal set that this class will execute. | AbstractCompositeTask | ||
addTasksBeforeRun():void
Sub-classes may override this method to J.I.T. | AbstractCompositeTask | ||
checkForTaskCompletion():void | AbstractCompositeTask | ||
customReset():void [override]
Override this method to perform any custom reset operations. | AbstractCompositeTask | ||
customRun():void [override]
Override this method to give your Task functionality. | AbstractCompositeTask | ||
![]() | dispatchProgressEvent():void | Task | |
flushTaskQueue(forcefullyPreventTaskFromCompleting:Boolean = false):void
Remove all Tasks from the queue. | AbstractCompositeTask | ||
![]() | getLoggerString(string:String):String
Returns a string for logging the specified task-state event. | Task | |
handleTaskCompletedOrRemoved(task:ITask):void
Convenience method for handling a completed Task and executing the next. | AbstractCompositeTask | ||
individualTaskComplete(task:ITask):void
Override this method to be notified when individual Tasks have successfully completed. | AbstractCompositeTask | ||
individualTaskStarted(task:ITask):void
Override this method to be notified when individual Tasks are started. | AbstractCompositeTask | ||
removeTaskEventListeners(task:ITask):void
Convenience method for removing TaskEvent listeners from a Task. | AbstractCompositeTask | ||
![]() | taskComplete(message:String, data:* = null):void
This method should be called upon Task completion. | Task | |
![]() | taskError(message:String, data:* = null):void
This method should be called upon Task failure. | Task | |
![]() | taskInterrupted(message:String, data:* = null):void
Call this method to interrupt the currently running Task. | Task | |
![]() | throwErrorIfAnyObjectInArrayIsNotATask(tasks:Array):void | Task | |
| _addTasksBeforeRunInvoked | property |
protected var _addTasksBeforeRunInvoked:Boolean| _erroredTasks | property |
protected var _erroredTasks:Array| _executeTaskInParallel | property |
protected var _executeTaskInParallel:Boolean| _flushTaskQueueLock | property |
protected var _flushTaskQueueLock:Boolean| _interruptedTask | property |
protected var _interruptedTask:ITask| _taskQueue | property |
protected var _taskQueue:Array| _taskQueueIndex | property |
protected var _taskQueueIndex:int| allTasksAreCompleted | property |
allTasksAreCompleted:Boolean [read-only] No incomplete Tasks remain in the queue.
protected function get allTasksAreCompleted():Boolean| currentSerialTask | property |
currentSerialTask:ITask [read-only] References the Task that is currently running (if this CompositeTask has been told to execute in serial).
protected function get currentSerialTask():ITask| errorDatas | property |
errorDatas:Array [read-only] Error datas from all inner Tasks that failed during execution. This value is valid after during execution of the CompositeTask as well as upon completion (or failure).
public function get errorDatas():Array| erroredTasks | property |
erroredTasks:Array [read-only] Tasks that errored during execution. This value is valid after during execution of the CompositeTask as well as upon completion (or failure).
public function get erroredTasks():Array| errorMessages | property |
errorMessages:Array [read-only] Unique error messages from all inner Tasks that failed during execution. This value is valid after during execution of the CompositeTask as well as upon completion (or failure).
public function get errorMessages():Array| interruptible | property |
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.
public function get interruptible():Boolean| numCompletedTasks | property |
numCompletedTasks:int [read-only] Number of inner Tasks that have successfully completed. This value is only valid while the CompositeTask is running. Upon completion (or failure) of the CompositeTask this value will be reset to 0.
public function get numCompletedTasks():int| numInternalOperations | property |
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.
public function get numInternalOperations():int| numInternalOperationsCompleted | property |
numInternalOperationsCompleted:int [read-only] [override] Number of internal operations that have completed. Sub-classes should override this method if containing a value > 1;
public function get numInternalOperationsCompleted():int| numPendingTasks | property |
numPendingTasks:int [read-only] Number of inner Tasks that have been started and have not yet completed. This value is only valid while the CompositeTask is running (or before it has been started). Upon completion (or failure) of the CompositeTask this value will be reset to 0.
public function get numPendingTasks():int| numTasks | property |
numTasks:int [read-only] Number of inner Tasks. This value is only valid while the CompositeTask is running (or before it has been started). Upon completion (or failure) of the CompositeTask this value will be reset to 0.
public function get numTasks():int| pendingTasks | property |
pendingTasks:Array [read-only] Tasks currently in the process of being executed. This value is only valid while the CompositeTask is running (or before it has been started). Upon completion (or failure) of the CompositeTask this value will be reset to 0.
public function get pendingTasks():Array| synchronous | property |
synchronous:Boolean [read-only] [override] The current task can be executed synchronously.
public function get synchronous():Boolean| taskQueue | property |
taskQueue:Array [read-only] TaskPrivateNamespace function get taskQueue():Array| taskQueueIndex | property |
taskQueueIndex:int [read-only] TaskPrivateNamespace function get taskQueueIndex():int| addFunction | () | method |
public function addFunction(closure:Function, closureIdentifier:String = null):TaskWithClosureAdds a function to the queue of Tasks by wrapping it inside of a TaskWithClosure. Functions added this way must be synchronous. This method is simply a convenience method for creating a TaskWithClosure and calling addTask().
Parameters
closure:Function — Function to be executed
| |
closureIdentifier:String (default = null) — Unique identifier for function (and its TaskWithClosure)
|
TaskWithClosure — Newly created TaskWithClosure
|
| addMultiple | () | method |
public function addMultiple(... tasksOrFunctions):voidAdds multiple Tasks or Functions to the internal set. This method is a convenience mehtod for calling addTask() or addFunction() multiple times.
Parameters
... tasksOrFunctions — Task or Function objects
|
Error — if any of the specified parameters is not a Task or a Function
|
| addTaskEventListeners | () | method |
protected function addTaskEventListeners(task:ITask):voidConvenience method for adding TaskEvent listeners to a Task.
Parameters
task:ITask |
| addTaskHelper | () | method |
protected function addTaskHelper(task:ITask):voidAdds another task to the internal set that this class will execute. Additional tasks may be safely at any time (including while the CompositeTask is executing). Tasks are added to the end, so in serial tasks, tasks added later will not be run if an earlier one fails.
Parameters
task:ITask |
| addTasksBeforeRun | () | method |
protected function addTasksBeforeRun():voidSub-classes may override this method to J.I.T. add child Tasks before the composite Task is run.
| checkForTaskCompletion | () | method |
protected function checkForTaskCompletion():void| customReset | () | method |
override protected function customReset():voidOverride this method to perform any custom reset operations.
| customRun | () | method |
override protected function customRun():voidOverride this method to give your Task functionality.
| flushTaskQueue | () | method |
protected function flushTaskQueue(forcefullyPreventTaskFromCompleting:Boolean = false):voidRemove all Tasks from the queue.
Parameters
forcefullyPreventTaskFromCompleting:Boolean (default = false) — Prevent CompositeTask from completing after queue has been cleared
|
| handleTaskCompletedOrRemoved | () | method |
protected function handleTaskCompletedOrRemoved(task:ITask):voidConvenience method for handling a completed Task and executing the next.
Parameters
task:ITask |
| individualTaskComplete | () | method |
protected function individualTaskComplete(task:ITask):voidOverride this method to be notified when individual Tasks have successfully completed.
Parameters
task:ITask |
| individualTaskStarted | () | method |
protected function individualTaskStarted(task:ITask):voidOverride this method to be notified when individual Tasks are started.
Parameters
task:ITask |
| interrupt | () | method |
override public function interrupt():BooleanInterruptible 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
ReturnsBoolean |
| removeFunction | () | method |
public function removeFunction(closure:Function):TaskWithClosureRemoves a function from the queue of Tasks by locating its corresponding TaskWithClosure. This method is simply a convenience method for locating the matching Task and calling removeTask().
Parameters
closure:Function — Function to be executed
|
TaskWithClosure — TaskWithClosure (if one found)
|
| removeMultiple | () | method |
public function removeMultiple(... tasksOrFunctions):voidRemoves multiple Tasks or Functions from the internal set. This method is a convenience mehtod for calling removeTask() or removeFunction() multiple times.
Parameters
... tasksOrFunctions — Task or Function objects
|
Error — if any of the specified parameters is not a Task or a Function
|
| removeTask | () | method |
public function removeTask(task:ITask):voidRemoves a task from the internal set that this class will execute. If the specified Task has not been executed before it is removed it will not be executed by the CompositeTask.
Parameters
task:ITask |
| removeTaskEventListeners | () | method |
protected function removeTaskEventListeners(task:ITask):voidConvenience method for removing TaskEvent listeners from a Task.
Parameters
task:ITask |