Packageorg.spicefactory.lib.command.base
Classpublic class AbstractAsyncCommand
InheritanceAbstractAsyncCommand Inheritance flash.events.EventDispatcher
Implements AsyncCommand
Subclasses AbstractCancellableCommand

Abstract base implementation of the AsyncCommand interface.

A subclass of AbstractAsyncCommand is expected to override the doStart method, do its work and then call complete when the operation is done (or error when the command fails to complete successfully).



Public Properties
 PropertyDefined By
  active : Boolean
[read-only] Indicates whether this command is currently executing.
AbstractAsyncCommand
Public Methods
 MethodDefined By
  
AbstractAsyncCommand(description:String = null)
Creates a new instance.
AbstractAsyncCommand
  
execute():void
Starts the execution of this command.
AbstractAsyncCommand
Protected Methods
 MethodDefined By
  
complete(result:Object = null):void
Signals that this command has completed.
AbstractAsyncCommand
  
doExecute():void
Invoked when the command starts executing.
AbstractAsyncCommand
  
error(cause:Object = null):void
Signals an error condition and cancels the command.
AbstractAsyncCommand
Property Detail
activeproperty
active:Boolean  [read-only]

Indicates whether this command is currently executing.


Implementation
    public function get active():Boolean
Constructor Detail
AbstractAsyncCommand()Constructor
public function AbstractAsyncCommand(description:String = null)

Creates a new instance.

Parameters
description:String (default = null) — a description of this command
Method Detail
complete()method
protected function complete(result:Object = null):void

Signals that this command has completed. Subclasses should call this method when the asynchronous operation has completed.

Parameters

result:Object (default = null)

doExecute()method 
protected function doExecute():void

Invoked when the command starts executing. Subclasses should override this method to start with the actual operation this command performs.

error()method 
protected function error(cause:Object = null):void

Signals an error condition and cancels the command. Subclasses should call this method when the asynchronous operation cannot be successfully completed.

Parameters

cause:Object (default = null) — the cause of the error

execute()method 
public function execute():void

Starts the execution of this command. If this command is member of a group or flow this method should not be called by application code.