Packageorg.springextensions.actionscript.core.operation
SVN browsingOperationQueue.as
FisheyeOperationQueue.as
Classpublic class OperationQueue
InheritanceOperationQueue Inheritance AbstractProgressOperation Inheritance AbstractOperation Inheritance flash.events.EventDispatcher
SubclassesLoadPropertiesBatchOperation

A queue of IOperation objects that dispatches an OperationEvent.COMPLETE event when all operations in the queue have completed (and dispatched a corresponding OperationEvent.COMPLETE event). Useful for invoking multiple operations and getting informed when all operations are finished without the need to keep track of each individual instance.

See also

OperationEvent


Documentation reference: operation queues


Public Properties
 PropertyDefined by
 Inheritederror : *
The error of this operation or null if no error occurred during this operation.
AbstractOperation
  name : String
[read-only] The name of the queue, or the generated name if none was passed into the constructor.
OperationQueue
 Inheritedprogress : uint
The progress of this operation.
AbstractProgressOperation
 Inheritedresult : *
The result of this operation or null if the operation does not have a result.
AbstractOperation
 Inheritedtimeout : int
The timeout in milliseconds.
AbstractOperation
 Inheritedtotal : uint
The total amount of progress this operation should make before being done.
AbstractProgressOperation
Public Methods
 MethodDefined by
  
OperationQueue(name:String = "")
Creates a new OperationQueue instance.
OperationQueue
 Inherited
addCompleteListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
addErrorListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.ERROR event.
AbstractOperation
  
addOperation(operation:IOperation):Boolean
Adds an operation to the queue.
OperationQueue
 Inherited
addProgressListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.PROGRESS event.
AbstractProgressOperation
 Inherited
addTimeoutListener(listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Convenience method for adding a listener to the OperationEvent.TIMEOUT event.
AbstractOperation
 Inherited
dispatchCompleteEvent(result:* = null):Boolean
Convenience method for dispatching a OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
dispatchErrorEvent(error:* = null):Boolean
Convenience method for dispatching a OperationEvent.ERROR event.
AbstractOperation
 Inherited
Convenience method for dispatching a OperationEvent.TIMEOUT event.
AbstractOperation
 Inherited
removeCompleteListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.COMPLETE event.
AbstractOperation
 Inherited
removeErrorListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.ERROR event.
AbstractOperation
 Inherited
removeProgressListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.PROGRESS event.
AbstractProgressOperation
 Inherited
removeTimeoutListener(listener:Function, useCapture:Boolean = false):void
Convenience method for removing a listener from the OperationEvent.TIMEOUT event.
AbstractOperation
  
toString():String
OperationQueue
Protected Methods
 MethodDefined by
  
Adds the operation_completeHandler and operation_errorHandler event handler to the specified operation instance.
OperationQueue
 Inherited
Convenience method for dispatching a OperationEvent.PROGRESS event.
AbstractProgressOperation
  
Handles the completion of an operation in this queue.
OperationQueue
  
Handles an error from an operation in this queue.
OperationQueue
  
Removes the operation_completeHandler and operation_errorHandler event handler from the specified operation instance.
OperationQueue
 Inherited
startTimeout():void
AbstractOperation
Events
 EventSummaryDefined by
   Dispatched when all the operations in the current OperationQueue have received a result.OperationQueue
 Inherited Dispatched when the current AbstractOperation has new progress information to report.AbstractProgressOperation
 Inherited Dispatched when the current AbstractOperation has completed its functionality successfully.AbstractOperation
 Inherited Dispatched when the current AbstractOperation encountered an error.AbstractOperation
 Inherited Dispatched when the current AbstractOperation timed out.AbstractOperation
Property detail
nameproperty
name:String  [read-only]

The name of the queue, or the generated name if none was passed into the constructor.

Implementation
    public function get name():String
Constructor detail
OperationQueue()constructor
public function OperationQueue(name:String = "")

Creates a new OperationQueue instance.

Parameters
name:String (default = "") — the name of the queue; if no name is given, one will be generated.
Method detail
addOperation()method
public function addOperation(operation:IOperation):Boolean

Adds an operation to the queue. The operation will not be added if it was previously added to the queue.

Parameters
operation:IOperation — The IOperation that needs to be added to the current queue.

Returns
Boolean — true if the operation was added; false if not
addOperationListeners()method 
protected function addOperationListeners(operation:IOperation):void

Adds the operation_completeHandler and operation_errorHandler event handler to the specified operation instance.

Parameters
operation:IOperation
operation_completeHandler()method 
protected function operation_completeHandler(event:OperationEvent):void

Handles the completion of an operation in this queue. An OperationEvent.PROGRESS event is dispatched when more operations are left in the queue, or if all operations are complete an OperationEvent.COMPLETE is dispatched.

Parameters
event:OperationEvent — the event of the operation that completed
operation_errorHandler()method 
protected function operation_errorHandler(event:OperationEvent):void

Handles an error from an operation in this queue.

Parameters
event:OperationEvent
removeOperationListeners()method 
protected function removeOperationListeners(operation:IOperation):void

Removes the operation_completeHandler and operation_errorHandler event handler from the specified operation instance.

Parameters
operation:IOperation
toString()method 
public override function toString():String

Returns
String — A String representation of the current OperationQueue.
Event detail
operationCompleteevent 
Event object type: org.springextensions.actionscript.core.operation.OperationEvent

Dispatched when all the operations in the current OperationQueue have received a result.