Packagecom.bourre.commands
Classpublic class AbstractSyncCommand
InheritanceAbstractSyncCommand Inheritance AbstractCommand
ImplementsASyncCommand
SubclassesAbstractMultiTween, AbstractTween, ASyncBatch, ASyncCommandSequencer, LoopCommand

Player version: Flash Player 9.0
Language version: ActionScript 3.0

AbstractSyncCommand provides a skeleton to create asynchronous stateless commands. As defined in the ASyncCommand interface, an asynchronous command hasn't finished its process at the end of the execute call. In that context, the command will dispatch an onCommandEnd event to notice its listener of the end of its process.

LowRA encourage the creation of stateless commands, it means that commands must realize all their process entirely in the execute call. The constructor of a stateless command should always be empty. In the case of an asynchronous command, the constructor initialize essentials properties which allow command owner to setup the command properly, and to register its FrontController to the command.

See the How to use the Command pattern implementation in LowRA document for more details on the commands package structure.



Protected Properties
 PropertyDefined by
  _bIsRunning : Boolean
A boolean value which indicates if this command is currently processing.
AbstractSyncCommand
  _eOnCommandEnd : BasicEvent
An event instance used as event object when dispatching the onCommandEnd event to its listener.
AbstractSyncCommand
  _oEB : EventBroadcaster
The internal event broadcaster.
AbstractSyncCommand
 Inherited_owner : Plugin
A reference to the plugin owner of this command.
AbstractCommand
Public Methods
 MethodDefined by
  
Initializes event dispatching behavior and Runnable implementation
AbstractSyncCommand
  
addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean
Adds the passed-in listener as listener for the onCommandEnd event of this command.
AbstractSyncCommand
  
execute(e:Event = null):void
By default the implementation of the execute method in the AbstratSyncCommand set it like running
AbstractSyncCommand
  
Fires the onCommandEnd event to the listeners of this command.
AbstractSyncCommand
 Inherited
Returns the exclusive logger object owned by the plugin.
AbstractCommand
 Inherited
getModel(key:String):AbstractModel
Returns a reference to the model AbstractModel.
AbstractCommand
 Inherited
Returns a reference to the owner of this command.
AbstractCommand
 Inherited
getView(key:String):AbstractView
Returns a reference to the view AbstractView.
AbstractCommand
 Inherited
isModelRegistered(key:String):Boolean
Check if a model AbstractModel is registered with passed key in owner's ModelLocator.
AbstractCommand
  
isRunning():Boolean
Returns true if this command is currently processing.
AbstractSyncCommand
 Inherited
isViewRegistered(key:String):Boolean
Check if a view AbstractView is registered with passed key in owner's ViewLocator.
AbstractCommand
  
Removes the passed-in listener for listening the onCommandEnd event of this command.
AbstractSyncCommand
  
run():void
Implementation of the Runnable interface, a call to run() is equivalent to a call to execute without argument.
AbstractSyncCommand
 Inherited
setOwner(owner:Plugin):void
Defines the plugin owner of this command.
AbstractCommand
  
toString():String
Returns the string representation of the object.
AbstractSyncCommand
Protected Methods
 MethodDefined by
 Inherited
firePrivateEvent(e:Event):void
Fires a private event directly on this command's owner.
AbstractCommand
Public Constants
 ConstantDefined by
  onCommandEndEVENT : String = "onCommandEnd"
[static] Name of the event dispatched at the end of the command's process.
AbstractSyncCommand
Property detail
_bIsRunningproperty
protected var _bIsRunning:Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

A boolean value which indicates if this command is currently processing.

_eOnCommandEndproperty 
protected var _eOnCommandEnd:BasicEvent

Player version: Flash Player 9.0
Language version: ActionScript 3.0

An event instance used as event object when dispatching the onCommandEnd event to its listener.

_oEBproperty 
protected var _oEB:EventBroadcaster

Player version: Flash Player 9.0
Language version: ActionScript 3.0

The internal event broadcaster.

Constructor detail
AbstractSyncCommand()constructor
public function AbstractSyncCommand()

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Initializes event dispatching behavior and Runnable implementation

Method detail
addASyncCommandListener()method
public function addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in listener as listener for the onCommandEnd event of this command.

Parameters
listener:ASyncCommandListener — object to be added as listener
 
... rest — additional arguments such defined by the EventBroacaster.addEventListener method

Returns
Boolean

See also

See the EventBroacaster.addEventListener() documentation
execute()method 
public override function execute(e:Event = null):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

By default the implementation of the execute method in the AbstratSyncCommand set it like running

Parameters
e:Event (default = null) — An event that will be used as data source by the command.
fireCommandEndEvent()method 
public function fireCommandEndEvent():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Fires the onCommandEnd event to the listeners of this command.

isRunning()method 
public function isRunning():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if this command is currently processing.

Returns
Booleantrue if this command is currently processing
removeASyncCommandListener()method 
public function removeASyncCommandListener(listener:ASyncCommandListener):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in listener for listening the onCommandEnd event of this command.

Parameters
listener:ASyncCommandListener — object to be removed as listener

Returns
Boolean
run()method 
public function run():void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Implementation of the Runnable interface, a call to run() is equivalent to a call to execute without argument.

toString()method 
public override function toString():String

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the string representation of the object.

Returns
String — the string representation of the object
Constant detail
onCommandEndEVENTconstant
public static const onCommandEndEVENT:String = "onCommandEnd"

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Name of the event dispatched at the end of the command's process.