Package | org.spicefactory.lib.command.base |
Class | public class AbstractSuspendableCommand |
Inheritance | AbstractSuspendableCommand AbstractCancellableCommand AbstractAsyncCommand flash.events.EventDispatcher |
Implements | SuspendableCommand |
Subclasses | AbstractCommandExecutor, LightCommandAdapter |
A subclass of AbstractCancellableCommand is expected
to override the doStart
, doCancel
, doSuspend
and doResume
methods and perform the necessary operations, and then call complete
when the operation is done (or error
when the command fails to complete successfully).
Property | Defined By | ||
---|---|---|---|
active : Boolean [read-only]
Indicates whether this command is currently executing. | AbstractAsyncCommand | ||
suspended : Boolean [read-only]
Indicates whether this command is currently suspended. | AbstractSuspendableCommand |
Method | Defined By | ||
---|---|---|---|
AbstractSuspendableCommand(description:String = null)
Creates a new instance. | AbstractSuspendableCommand | ||
cancel():void
Cancels the command. | AbstractCancellableCommand | ||
execute():void
Starts the execution of this command. | AbstractAsyncCommand | ||
resume():void
Resumes the command. | AbstractSuspendableCommand | ||
suspend():void
Suspends the command. | AbstractSuspendableCommand |
Method | Defined By | ||
---|---|---|---|
complete(result:Object = null):void
Signals that this command has completed. | AbstractAsyncCommand | ||
doCancel():void
Invoked when this command gets cancelled. | AbstractCancellableCommand | ||
doExecute():void
Invoked when the command starts executing. | AbstractAsyncCommand | ||
doResume():void
Invoked when this command gets resumed. | AbstractSuspendableCommand | ||
doSuspend():void
Invoked when this command gets suspended. | AbstractSuspendableCommand | ||
error(cause:Object = null):void
Signals an error condition and cancels the command. | AbstractAsyncCommand |
suspended | property |
suspended:Boolean
[read-only] Indicates whether this command is currently suspended.
public function get suspended():Boolean
AbstractSuspendableCommand | () | Constructor |
public function AbstractSuspendableCommand(description:String = null)
Creates a new instance.
Parametersdescription:String (default = null ) — a description of this command
|
doResume | () | method |
protected function doResume():void
Invoked when this command gets resumed. Subclasses should override this method and resume the suspended operation this command performs.
doSuspend | () | method |
protected function doSuspend():void
Invoked when this command gets suspended. Subclasses should override this method and suspend the actual operation this command performs.
resume | () | method |
public function resume():void
Resumes the command. Calling this method only has an effect if the command is currently suspended.
suspend | () | method |
public function suspend():void
Suspends the command. Calling this method only has an effect if the command is currently executing.