| Package | com.bourre.commands |
| Class | public class AbstractSyncCommand |
| Inheritance | AbstractSyncCommand AbstractCommand |
| Implements | ASyncCommand |
| Subclasses | AbstractMultiTween, 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.
| Property | Defined 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 | ||
![]() | _owner : Plugin
A reference to the plugin owner of this command.
| AbstractCommand | |
| Method | Defined 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 | ||
|
fireCommandEndEvent():void
Fires the
onCommandEnd event to the listeners
of this command. | AbstractSyncCommand | ||
![]() |
Returns the exclusive logger object owned by the plugin.
| AbstractCommand | |
![]() |
getModel(key:String):AbstractModel
Returns a reference to the model
AbstractModel. | AbstractCommand | |
![]() |
Returns a reference to the owner of this command.
| AbstractCommand | |
![]() |
getView(key:String):AbstractView
Returns a reference to the view
AbstractView. | AbstractCommand | |
![]() |
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 | ||
![]() |
isViewRegistered(key:String):Boolean
Check if a view
AbstractView is registered
with passed key in owner's ViewLocator. | AbstractCommand | |
|
removeASyncCommandListener(listener:ASyncCommandListener):Boolean
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 | ||
![]() |
Defines the plugin owner of this command.
| AbstractCommand | |
|
toString():String
Returns the string representation of the object.
| AbstractSyncCommand | ||
| Constant | Defined by | ||
|---|---|---|---|
| onCommandEndEVENT : String = "onCommandEnd" [static]
Name of the event dispatched at the end of the command's process.
| AbstractSyncCommand | ||
| _bIsRunning | property |
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.
| _eOnCommandEnd | property |
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.
| _oEB | property |
protected var _oEB:EventBroadcaster
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
The internal event broadcaster.
| AbstractSyncCommand | () | constructor |
public function AbstractSyncCommand()
| Player version: | Flash Player 9.0 |
| Language version: | ActionScript 3.0 |
Initializes event dispatching behavior and Runnable
implementation
| 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.
listener:ASyncCommandListener — object to be added as listener
|
|
... rest — additional arguments such defined by the
EventBroacaster.addEventListener method
|
Boolean |
See also
| 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
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.
Boolean — true 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.
listener:ASyncCommandListener — object to be removed as listener
|
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.
ReturnsString — the string representation of the object
|
| onCommandEndEVENT | constant |
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.