Packageorg.springextensions.actionscript.core.command
SVN browsingGenericOperationCommand.as
FisheyeGenericOperationCommand.as
Classpublic class GenericOperationCommand
InheritanceGenericOperationCommand Inheritance AbstractProgressOperation Inheritance AbstractOperation Inheritance flash.events.EventDispatcher
ImplementsIApplicationDomainAware, IAsyncCommand

Generic ICommand implementation that can be used to wrap arbitrary IOperation or IProgressOperation implementations. This way immediate execution of the IOperation can be defered to an instance of this class.

See also

IOperation
IProgressOperation


Documentation reference: genericoperationcommand


Public Properties
 PropertyDefined by
  applicationDomain : ApplicationDomain
[write-only]
GenericOperationCommand
  constructorArguments : Array
An array of arguments that will be passed to the constructor of the specified IOperation implementation.
GenericOperationCommand
 Inheritederror : *
The error of this operation or null if no error occurred during this operation.
AbstractOperation
  operationClass : Class
[read-only] The specified IOperation implementation that will be created when the current GenericOperationCommand is executed.
GenericOperationCommand
 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
  
GenericOperationCommand(operationClass:Class, ... constructorArgs)
Creates a new GenericOperationCommand instance.
GenericOperationCommand
 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
 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
  
createNew(clazz:Class, constructorArgs:Array):GenericOperationCommand
[static]
GenericOperationCommand
 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
  
execute():*
Creates an instance of the specified IOperation with the specified constructor arguments.
GenericOperationCommand
 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
Protected Methods
 MethodDefined by
 Inherited
Convenience method for dispatching a OperationEvent.PROGRESS event.
AbstractProgressOperation
  
genericOperationCommandInit(operationClass:Class, constructorArgs:Array = null):void
GenericOperationCommand
  
Event handler for the specified IOperation's OperationEvent.COMPLETE event.
GenericOperationCommand
  
Event handler for the specified IOperation's OperationEvent.ERROR event.
GenericOperationCommand
  
GenericOperationCommand
  
Removes the complete and error listeners from the IOperation's instance.
GenericOperationCommand
 Inherited
startTimeout():void
AbstractOperation
Events
 EventSummaryDefined by
 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
applicationDomainproperty
applicationDomain:ApplicationDomain  [write-only]Implementation
    public function set applicationDomain(value:ApplicationDomain):void
constructorArgumentsproperty 
constructorArguments:Array  [read-write]

An array of arguments that will be passed to the constructor of the specified IOperation implementation.

Implementation
    public function get constructorArguments():Array
    public function set constructorArguments(value:Array):void
operationClassproperty 
operationClass:Class  [read-only]

The specified IOperation implementation that will be created when the current GenericOperationCommand is executed.

Implementation
    public function get operationClass():Class
Constructor detail
GenericOperationCommand()constructor
public function GenericOperationCommand(operationClass:Class, ... constructorArgs)

Creates a new GenericOperationCommand instance.

Parameters
operationClass:Class — The specified IOperation implementation that will be created.
 
... constructorArgs — An array of arguments that will be passed to the constructor of the specified IOperation implementation.
Method detail
createNew()method
public static function createNew(clazz:Class, constructorArgs:Array):GenericOperationCommandParameters
clazz:Class
 
constructorArgs:Array

Returns
GenericOperationCommand
execute()method 
public function execute():*

Creates an instance of the specified IOperation with the specified constructor arguments. Adds a complete and error event listener to redispatch the IOperation events through the current GenericOperationCommand.

Returns
*
genericOperationCommandInit()method 
protected function genericOperationCommandInit(operationClass:Class, constructorArgs:Array = null):voidParameters
operationClass:Class
 
constructorArgs:Array (default = null)
operationComplete()method 
protected function operationComplete(event:OperationEvent):void

Event handler for the specified IOperation's OperationEvent.COMPLETE event.

Parameters
event:OperationEvent
operationError()method 
protected function operationError(event:OperationEvent):void

Event handler for the specified IOperation's OperationEvent.ERROR event.

Parameters
event:OperationEvent
operationProgress()method 
protected function operationProgress(event:OperationEvent):voidParameters
event:OperationEvent
removeListeners()method 
protected function removeListeners():void

Removes the complete and error listeners from the IOperation's instance.