Package | com.rosettastone.library.taskmanager |
Class | public class AbstractTaskManager |
Inheritance | AbstractTaskManager ![]() ![]() |
Subclasses | InterruptibleTaskManager, TaskManager |
Property | Defined By | ||
---|---|---|---|
completed : Boolean [read-only]
There are no pending or active Tasks. | AbstractTaskManager | ||
![]() | 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. | 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 | ||
![]() | id : Number [read-only]
| Task | |
interruptible : Boolean [override] [read-only]
The current Task can be interrupted. | AbstractTaskManager | ||
![]() | 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 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 | ||
![]() | numInternalOperationsPending : int [read-only]
Number of internal operations not yet completed. | Task | |
numTasks : int [read-only]
Number of Tasks to be executed by TaskManager. | AbstractTaskManager | ||
![]() | 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 | |
![]() | running : Boolean [read-only]
The task is currently running. | Task | |
synchronous : Boolean [override] [read-only]
The current task can be executed synchronously. | AbstractTaskManager | ||
![]() | taskIdentifier : String
(Optional) human-readable label for task. | Task | |
![]() | uniqueID : Number [read-only]
Unique ID for a task. | Task |
Method | Defined By | ||
---|---|---|---|
![]() |
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. | AbstractTaskManager | ||
![]() | 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 | |
![]() | 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 | ||
---|---|---|---|
addTaskHelper(task:ITask, dependencies:Array = null):void
Adds a task to the graph and set its dependencies. | AbstractTaskManager | ||
customReset():void [override]
Override this method to perform any custom reset operations. | AbstractTaskManager | ||
customRun():void [override]
Override this method to give your Task functionality. | AbstractTaskManager | ||
![]() | dispatchProgressEvent():void | Task | |
![]() | 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 | ||
![]() | 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 |
Event | Summary | Defined By | ||
---|---|---|---|---|
![]() | Task | |||
![]() | Task | |||
![]() | Task | |||
![]() | Task | |||
![]() | Task | |||
![]() | Task | |||
AbstractTaskManager | ||||
AbstractTaskManager | ||||
AbstractTaskManager |
completed | property |
completed:Boolean
[read-only] There are no pending or active Tasks.
public function get completed():Boolean
errorDatas | property |
errorDatas:Array
[read-only] Error datas from all inner Tasks that failed during execution.
public function get errorDatas():Array
erroredTasks | property |
erroredTasks:Array
[read-only] Tasks that errored during execution.
public function get erroredTasks():Array
errorMessages | property |
errorMessages:Array
[read-only] Unique error messages from all inner Tasks that failed during execution.
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 Tasks that have successfully completed execution.
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
numTasks | property |
numTasks:int
[read-only] Number of Tasks to be executed by TaskManager.
public function get numTasks():int
synchronous | property |
synchronous:Boolean
[read-only] [override] The current task can be executed synchronously.
public function get synchronous():Boolean
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
|
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
ReturnsBoolean |
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
|
taskManagerEventComplete | Event |
taskManagerEventError | Event |
taskManagerEventInterrupted | Event |