| Package | org.springextensions.actionscript.core.task.support |
| SVN browsing | Task.as |
| Fisheye | Task.as |
| Class | public class Task |
| Inheritance | Task AbstractOperation flash.events.EventDispatcher |
| Implements | IDisposable, ITask |
| Subclasses | AbstractTaskBlock |
IOperation implementations.
| Property | Defined by | ||
|---|---|---|---|
| context : Object
An anonymous object that can be used to store values that can be accessed by other client code
to pass around these values between commands.
| Task | ||
![]() | error : *
The error of this operation or
null if no error occurred during this operation. | AbstractOperation | |
| failOnFault : Boolean = true
Determines if the entire controlflow of the current
ITask will be aborted if an error occurs. | Task | ||
| isDisposed : Boolean [read-only]
Returns
true if the dispose() has already been invoked before. | Task | ||
| parent : ITask
| Task | ||
![]() | result : *
The result of this operation or
null if the operation does not have a result. | AbstractOperation | |
![]() | timeout : int
The timeout in milliseconds.
| AbstractOperation | |
| Property | Defined by | ||
|---|---|---|---|
| commandList : Array
Internal
Array of the commands, tasks and controlflow objects that will be executed. | Task | ||
| currentCommand : ICommand
The current
ICommand instance that is being executed. | Task | ||
| finishedCommandList : Array
Internal
Array of the commands, tasks and controlflow objects that have been executed. | Task | ||
| Method | Defined by | ||
|---|---|---|---|
|
Task()
Creates a new
Task instance. | Task | ||
![]() |
addCompleteListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.COMPLETE event.
| AbstractOperation | |
![]() |
addErrorListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.ERROR event.
| AbstractOperation | |
![]() |
addTimeoutListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.TIMEOUT event.
| AbstractOperation | |
|
Adds an
ICommand that will be executed in parallel. | Task | ||
|
| Task | ||
|
| Task | ||
![]() |
dispatchCompleteEvent(result:* = null):Boolean
Convenience method for dispatching a
OperationEvent.COMPLETE event. | AbstractOperation | |
![]() |
dispatchErrorEvent(error:* = null):Boolean
Convenience method for dispatching a
OperationEvent.ERROR event. | AbstractOperation | |
![]() |
dispatchTimeoutEvent():Boolean
Convenience method for dispatching a
OperationEvent.TIMEOUT event. | AbstractOperation | |
|
dispose():void
Release any resources that the current object might hold a reference to.
| Task | ||
|
Switches the current
IIfElseBlock control flow to its else block. | Task | ||
|
Closes the current
ITaskBlock. | Task | ||
|
execute():*
Executes the command.
| Task | ||
|
Stops the execution chain completely.
| Task | ||
|
Adds a repeating execution block which will be executed a specified number of times, determined by the specified
count or ICountProvider parameters. | Task | ||
|
Adds a conditional execution block to the current
ITask which will only
be executed if the specified IConditionProvider return true. | Task | ||
|
Adds an
ICommand that will be executed in sequence. | Task | ||
|
Pauses the current
ITask for the specified amount of milliseconds. | Task | ||
![]() |
removeCompleteListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.COMPLETE event.
| AbstractOperation | |
![]() |
removeErrorListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.ERROR event.
| AbstractOperation | |
![]() |
removeTimeoutListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.TIMEOUT event.
| AbstractOperation | |
|
Restarts the execution of the current
ITask. | Task | ||
|
Adds a repeating execution block which will be executed until the specified
IConditionProvider returns false. | Task | ||
| Method | Defined by | ||
|---|---|---|---|
|
Examines the current
ICommand in the controlflow and based on that either adds the specified ICommand
to the current ICommand or creates a new TaskCommand and adds it to this. | Task | ||
|
addCommandListeners(asyncCommand:IOperation):void
| Task | ||
|
Adds a new
TaskCommand with the specified ComposeiteCommandKind to the controlflow of the current ITask. | Task | ||
|
addToCommandList(command:ICommand):void
Adds the specified
ICommand instance to the control flow of the current ITask, if the specified
ICommand is also an implementation of ITask, the current ITask will be set as its parent. | Task | ||
|
completeExecution():void
| Task | ||
|
dispatchTaskEvent(eventType:String, command:ICommand = null):void
| Task | ||
|
executeCommand(command:ICommand):void
| Task | ||
|
executeNextCommand():void
| Task | ||
|
exit_handler(event:TaskFlowControlEvent):void
| Task | ||
|
initTask():void
| Task | ||
|
onCommandFault(event:OperationEvent):void
| Task | ||
|
onCommandResult(event:OperationEvent):void
| Task | ||
|
redispatchCompositeCommand(event:CompositeCommandEvent):void
| Task | ||
|
redispatchTaskEvent(event:TaskEvent):void
| Task | ||
|
removeCommandListeners(asyncCommand:IOperation):void
| Task | ||
|
resetCommandList():void
| Task | ||
![]() |
startTimeout():void
| AbstractOperation | |
|
TaskFlowControlEvent_handler(event:TaskFlowControlEvent):void
| Task | ||
| commandList | property |
protected var commandList:Array
Internal Array of the commands, tasks and controlflow objects that will be executed.
| context | property |
context:Object [read-write]An anonymous object that can be used to store values that can be accessed by other client code to pass around these values between commands.
Implementation public function get context():Object
public function set context(value:Object):void
| currentCommand | property |
protected var currentCommand:ICommand
The current ICommand instance that is being executed.
| failOnFault | property |
public var failOnFault:Boolean = true
Determines if the entire controlflow of the current ITask will be aborted if an error occurs.
| finishedCommandList | property |
protected var finishedCommandList:Array
Internal Array of the commands, tasks and controlflow objects that have been executed.
| isDisposed | property |
isDisposed:Boolean [read-only]
Returns true if the dispose() has already been invoked before.
public function get isDisposed():Boolean
| parent | property |
parent:ITask [read-write]Implementation
public function get parent():ITask
public function set parent(value:ITask):void
| Task | () | constructor |
public function Task()
Creates a new Task instance.
| addCommand | () | method |
protected function addCommand(command:ICommand, kind:CompositeCommandKind):ITask
Examines the current ICommand in the controlflow and based on that either adds the specified ICommand
to the current ICommand or creates a new TaskCommand and adds it to this.
command:ICommand — The specified ICommand.
|
|
kind:CompositeCommandKind |
ITask —
The current ICommand if it is an ITaskBlock, otherwise null.
|
| addCommandListeners | () | method |
protected function addCommandListeners(asyncCommand:IOperation):voidParameters
asyncCommand:IOperation |
| addTaskCommand | () | method |
protected function addTaskCommand(kind:CompositeCommandKind):CompositeCommand
Adds a new TaskCommand with the specified ComposeiteCommandKind to the controlflow of the current ITask.
kind:CompositeCommandKind — The specified ComposeiteCommandKind
|
CompositeCommand —
The newly created TaskCommand
|
| addToCommandList | () | method |
protected function addToCommandList(command:ICommand):void
Adds the specified ICommand instance to the control flow of the current ITask, if the specified
ICommand is also an implementation of ITask, the current ITask will be set as its parent.
command:ICommand — The specified ICommand instance.
|
| and | () | method |
public function and(item:Object, ... constructorArgs):ITask
Adds an ICommand that will be executed in parallel.
item:Object — The specified ICommand
|
|
... constructorArgs |
ITask —
A reference to the current ITask
|
| break_ | () | method |
| completeExecution | () | method |
protected function completeExecution():void
| continue_ | () | method |
| dispatchTaskEvent | () | method |
protected function dispatchTaskEvent(eventType:String, command:ICommand = null):voidParameters
eventType:String |
|
command:ICommand (default = null) |
| dispose | () | method |
public function dispose():voidRelease any resources that the current object might hold a reference to.
| else_ | () | method |
public function else_():IIfElseBlock
Switches the current IIfElseBlock control flow to its else block.
IIfElseBlock —
The current IIfElseBlock instance.
|
| end | () | method |
| execute | () | method |
public function execute():*Executes the command.
Returns* |
| executeCommand | () | method |
| executeNextCommand | () | method |
protected function executeNextCommand():void
| exit | () | method |
public function exit():ITaskStops the execution chain completely.
ReturnsITask —
The current ITask.
|
| exit_handler | () | method |
protected function exit_handler(event:TaskFlowControlEvent):voidParameters
event:TaskFlowControlEvent |
| for_ | () | method |
public function for_(count:uint, countProvider:ICountProvider = null, forBlock:IForBlock = null):IForBlock
Adds a repeating execution block which will be executed a specified number of times, determined by the specified count or ICountProvider parameters.
count:uint — The specified ICountProvider. This argument is ignored if the forBlock argument is not null.
|
|
countProvider:ICountProvider (default = null) — Optional IForBlock instance, if this is null a new instance will be created.
|
|
forBlock:IForBlock (default = null) |
IForBlock —
The new IForBlock instance.
|
| if_ | () | method |
public function if_(conditionProvider:IConditionProvider = null, ifElseBlock:IIfElseBlock = null):IIfElseBlock
Adds a conditional execution block to the current ITask which will only
be executed if the specified IConditionProvider return true.
conditionProvider:IConditionProvider (default = null) — The specified IConditionProvider. This argument is ignored if the ifElseBlock argument is not null.
|
|
ifElseBlock:IIfElseBlock (default = null) — Optional IIfElseBlock instance, if this is null a new instance will be created.
|
IIfElseBlock —
The new IIfElseBlock instance.
|
| initTask | () | method |
protected function initTask():void
| next | () | method |
public function next(item:Object, ... constructorArgs):ITask
Adds an ICommand that will be executed in sequence.
item:Object — The specified ICommand
|
|
... constructorArgs |
ITask —
A reference to the current ITask
|
| onCommandFault | () | method |
| onCommandResult | () | method |
| pause | () | method |
public function pause(duration:uint, pauseCommand:ICommand = null):ITask
Pauses the current ITask for the specified amount of milliseconds.
duration:uint — The specified amount of milliseconds
|
|
pauseCommand:ICommand (default = null) — ICommand instance to be used as a pause command, if this parameter is not null the duration parameter is ignored.
|
ITask —
The current ITask.
|
| redispatchCompositeCommand | () | method |
protected function redispatchCompositeCommand(event:CompositeCommandEvent):voidParameters
event:CompositeCommandEvent |
| redispatchTaskEvent | () | method |
| removeCommandListeners | () | method |
protected function removeCommandListeners(asyncCommand:IOperation):voidParameters
asyncCommand:IOperation |
| reset | () | method |
public function reset(doHardReset:Boolean = false):ITask
Restarts the execution of the current ITask.
doHardReset:Boolean (default = false) |
ITask —
The current ITask.
|
| resetCommandList | () | method |
protected function resetCommandList():void
| TaskFlowControlEvent_handler | () | method |
protected function TaskFlowControlEvent_handler(event:TaskFlowControlEvent):voidParameters
event:TaskFlowControlEvent |
| while_ | () | method |
public function while_(conditionProvider:IConditionProvider = null, whileBlock:IWhileBlock = null):IWhileBlock
Adds a repeating execution block which will be executed until the specified IConditionProvider returns false.
conditionProvider:IConditionProvider (default = null) — The specified IConditionProvider. This argument is ignored if the whileBlock argument is not null.
|
|
whileBlock:IWhileBlock (default = null) — Optional IWhileBlock instance, if this is null a new instance will be created.
|
IWhileBlock —
The new IWhileBlock instance.
|