Packagecom.bourre.commands
Classpublic class ASyncBatch
InheritanceASyncBatch Inheritance AbstractSyncCommand Inheritance AbstractCommand
ImplementsASyncCommandListener, MacroCommand
SubclassesASyncQueue

Player version: Flash Player 9.0
Language version: ActionScript 3.0

An asynchronous batch behave as a normal batch, but is designed to handle asynchronous commands. A command executed by this batch could only start when the previous command have fire its onCommandEnd event.

The Event object received in the execute is passed to each commands contained in this batch.

The ASyncBatch class extends AbstractSyncCommand and so, dispatch an onCommandEnd event at the execution end of all commands.



Protected Properties
 PropertyDefined by
  _aCommands : Array
Contains all commands currently in this macro command
ASyncBatch
 Inherited_bIsRunning : Boolean
A boolean value which indicates if this command is currently processing.
AbstractSyncCommand
  _eEvent : Event
Event received by the batch and redispatched to the internal commands execute method.
ASyncBatch
 Inherited_eOnCommandEnd : BasicEvent
An event instance used as event object when dispatching the onCommandEnd event to its listener.
AbstractSyncCommand
  _nIndex : Number
Store the index of the currently executed command.
ASyncBatch
 Inherited_oEB : EventBroadcaster
The internal event broadcaster.
AbstractSyncCommand
  _oLastCommand : ASyncCommand
Last executed command
ASyncBatch
 Inherited_owner : Plugin
A reference to the plugin owner of this command.
AbstractCommand
Public Methods
 MethodDefined by
  
Creates a new asynchronous batch object.
ASyncBatch
 Inherited
addASyncCommandListener(listener:ASyncCommandListener, ... rest):Boolean
Adds the passed-in listener as listener for the onCommandEnd event of this command.
AbstractSyncCommand
  
addCommand(command:Command):Boolean
Adds the passed-in command to this macro command.
ASyncBatch
  
execute(e:Event = null):void
Starts the execution of the batch.
ASyncBatch
 Inherited
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
 Inherited
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
  
onCommandEnd(e:Event):void
Receive events from its internal asynchronous commands.
ASyncBatch
 Inherited
Removes the passed-in listener for listening the onCommandEnd event of this command.
AbstractSyncCommand
  
removeCommand(command:Command):Boolean
Removes the passed-in command from this macro command.
ASyncBatch
 Inherited
run():void
Implementation of the Runnable interface, a call to run() is equivalent to a call to execute without argument.
AbstractSyncCommand
  
setOwner(owner:Plugin):void
Defines the plugin owner of this command.
ASyncBatch
 Inherited
toString():String
Returns the string representation of the object.
AbstractSyncCommand
Protected Methods
 MethodDefined by
  
_hasNext():Boolean
Returns true if there is a command to execute.
ASyncBatch
  
Returns the next command to execute.
ASyncBatch
 Inherited
firePrivateEvent(e:Event):void
Fires a private event directly on this command's owner.
AbstractCommand
Public Constants
 ConstantDefined by
 InheritedonCommandEndEVENT : String = "onCommandEnd"
[static] Name of the event dispatched at the end of the command's process.
AbstractSyncCommand
Property detail
_aCommandsproperty
protected var _aCommands:Array

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Contains all commands currently in this macro command

_eEventproperty 
protected var _eEvent:Event

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Event received by the batch and redispatched to the internal commands execute method.

_nIndexproperty 
protected var _nIndex:Number

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Store the index of the currently executed command.

_oLastCommandproperty 
protected var _oLastCommand:ASyncCommand

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Last executed command

Constructor detail
ASyncBatch()constructor
public function ASyncBatch()

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Creates a new asynchronous batch object.

Method detail
_hasNext()method
protected function _hasNext():Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns true if there is a command to execute.

Returns
Booleantrue if there is a command to execute
_next()method 
protected function _next():ASyncCommand

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns the next command to execute.

Returns
ASyncCommand — the next command to execute
addCommand()method 
public function addCommand(command:Command):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Adds the passed-in command to this macro command.

Parameters
command:Command — command to add in this macro command

Returns
Booleantrue if the command have been succesfully added. The addCommand ensure that the command exist in the macro command at the end of the call
execute()method 
public override function execute(e:Event = null):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Starts the execution of the batch. The received event is registered and then passed to sub commands.

Parameters
e:Event (default = null)
onCommandEnd()method 
public function onCommandEnd(e:Event):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Receive events from its internal asynchronous commands.

Parameters
e:Event
removeCommand()method 
public function removeCommand(command:Command):Boolean

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Removes the passed-in command from this macro command.

Parameters
command:Command — command to remove from this macro command

Returns
Booleantrue if the command have been succesfully removed
setOwner()method 
public override function setOwner(owner:Plugin):void

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Defines the plugin owner of this command. Generally the owner is defined by the FrontController of a plugin when it instantiate a command.

Parameters
owner:Plugin — plugin which will own the command