Packagecom.rosettastone.library.taskmanager
Classpublic class InnocuousTaskDecorator
InheritanceInnocuousTaskDecorator Inheritance InterruptibleTask Inheritance Task Inheritance flash.events.EventDispatcher
Implements IDecoratorTask

Decorates a Task but re-dispatches both error and success events as success. This type of decorator should be used for Tasks that are required and are blocking, but should not be considered fatal in the event of a failure.



Public Properties
 PropertyDefined By
 Inheriteddata : *
[read-only] Optional data parameter passed to the Task complete/error/interruption method.
Task
  decoratedTask : ITask
[read-only] Inner (decorated) Task.
InnocuousTaskDecorator
 Inheritedid : Number
[read-only]
Task
 Inheritedinterruptible : Boolean
[override] [read-only] The current Task can be interrupted.
InterruptibleTask
 InheritedinterruptingTask : ITask
[read-only] The Task currently interrupting the composite Task's execution (or NULL if no such Task exists).
Task
  isComplete : Boolean
[override] [read-only] The current task has successfully completed execution.
InnocuousTaskDecorator
 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
 InheritednumInternalOperations : int
[read-only] Number of internal operations conducted by this task.
Task
 InheritednumInternalOperationsCompleted : int
[read-only] Number of internal operations that have completed.
Task
 InheritednumInternalOperationsPending : int
[read-only] Number of internal operations not yet completed.
Task
 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
  running : Boolean
[override] [read-only] The task is currently running.
InnocuousTaskDecorator
 Inheritedsynchronous : Boolean
[read-only] The current task can be executed synchronously.
Task
 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
  
InnocuousTaskDecorator(decorated:ITask, taskIdentifier:String = null)
InnocuousTaskDecorator
 Inherited
and(... chainedTasks):ITask
Executes the specified tasks when the current task is executed.
Task
 Inherited
Task
  
interrupt():Boolean
[override] Interrupt the current Task.
InnocuousTaskDecorator
 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
  
reset():void
[override] Resets the task to it's pre-run state.
InnocuousTaskDecorator
 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
 Inherited
Sub-classes should override this method to implement interruption behavior (removing event listeners, pausing objects, etc.).
InterruptibleTask
 Inherited
Override this method to perform any custom reset operations.
Task
  
customRun():void
[override] Override this method to give your Task functionality.
InnocuousTaskDecorator
 Inherited
Task
 Inherited
getLoggerString(string:String):String
Returns a string for logging the specified task-state event.
Task
 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
Property Detail
decoratedTaskproperty
decoratedTask:ITask  [read-only]

Inner (decorated) Task.


Implementation
    public function get decoratedTask():ITask
isCompleteproperty 
isComplete:Boolean  [read-only] [override]

The current task has successfully completed execution.


Implementation
    public function get isComplete():Boolean
runningproperty 
running:Boolean  [read-only] [override]

The task is currently running. This value is FALSE if the task has not been run, has completed run (succesfully or due to a failure), or has been interrupted.


Implementation
    public function get running():Boolean
Constructor Detail
InnocuousTaskDecorator()Constructor
public function InnocuousTaskDecorator(decorated:ITask, taskIdentifier:String = null)



Parameters
decorated:ITask
 
taskIdentifier:String (default = null)
Method Detail
customRun()method
override protected function customRun():void

Override this method to give your Task functionality.

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

Interrupt the current Task. Interruptions should be handled in such a way as to allow a subsequent call to run() to resume gracefully. This mehtod should trigger an event of type TaskEvent.INTERRUPTED.

Returns
Boolean — TRUE if the Task has been successfully interrupted
reset()method 
override public function reset():void

Resets the task to it's pre-run state. This allows it to be re-run. This method can only be called on non-running tasks.