Packagecom.asfusion.mate.actions.builders
Classpublic class DelegateInvoker
InheritanceDelegateInvoker Inheritance ServiceInvokerBuilder Inheritance AbstractServiceInvoker Inheritance BaseAction Inheritance AbstractAction
ImplementsIAction

The DelegateInvoker can be used with any method that returns an AsyncToken. Behind the scenes, the DelegateInvoker attaches a responder to the AsyncToken returned by the method. The responder listens for success/failure and triggers the inner handlers when the method call returns. If the method does not return an AsyncToken to attach a responder to a runtime error is logged.



Public Properties
 PropertyDefined by
  arguments : *
The property arguments allows you to pass an Object or an Array of objects when calling the function defined in the property method.
DelegateInvoker
 Inheritedcache : String
The cache attribute lets you specify whether this newly created object should be kept live so that the next time an instance of this class is requested, this already created object is returned instead.
ServiceInvokerBuilder
 InheritedconstructorArguments : *
The constructorArgs allows you to pass an Object or an Array of objects to the contructor when the instance is created.
ServiceInvokerBuilder
 Inheriteddebug : Boolean
Whether to show debugging information for its inner-handlerss.
AbstractServiceInvoker
 InheritedfaultHandlers : Array
A set of inner-handlers to run when the server call returns a fault.
AbstractServiceInvoker
 Inheritedgenerator : Class
The generator attribute specifies what class should be instantiated.
ServiceInvokerBuilder
  instance : *
The instance of the Delegate to use.
DelegateInvoker
  method : String
The method attribute specifies what function to call on the delegate instance.
DelegateInvoker
 Inheritedproperties : Array
Properties allows you to add properties to the currentInstance.
BaseAction
 InheritedregisterTarget : Boolean
Registers the newly created object as an injector target.
ServiceInvokerBuilder
 InheritedresultHandlers : Array
A set of inner-handlers to run when the server call returns a result.
AbstractServiceInvoker
  showBusyCursor : Boolean = false
If true, a busy cursor is displayed while a service is executing.
DelegateInvoker
Protected Properties
 PropertyDefined by
 InheritedautoUnregistration : Boolean = true
When auto unregistration is true, all inner handlers will be unregistered after the first inner handlers fires.
AbstractServiceInvoker
 InheritedcurrentIndex : int = 0
Index used to store groups of inner handlers.
AbstractServiceInvoker
 InheritedcurrentInstance : * = null
The currentInstance is the Object that this class will use and modify to do its work.
AbstractAction
 Inheriteddocument : Object
A reference to the document object associated with the IActionList that contains this action item.
AbstractAction
 InheritedinnerHandlersClass : Class
Class that is used as a template to create the inner-handlers
AbstractServiceInvoker
 InheritedinnerHandlersDispatcher : IEventDispatcher
Dispatcher that will trigger the inner-handlers execution by dispatching events (ie: ResultEvent or FaultEvent).
AbstractServiceInvoker
 InheritedinnerHandlersList : Array
Inner handlers list that stores all inner handlers indexed by the currentIndex.
AbstractServiceInvoker
  token : AsyncToken
Generated when making asynchronous RPC operations.
DelegateInvoker
Public Methods
 MethodDefined by
  
Contructor
DelegateInvoker
 Inherited
initialized(document:Object, id:String):void
Called automatically by the MXML compiler if the AbstractAction is set up by using a tag.
AbstractAction
 Inherited
trigger(scope:IScope):void
This method gets called when the IActionList (ex: EventHandlers) is running.
AbstractAction
Protected Methods
 MethodDefined by
 Inherited
Handler that will be fired when the first of the innerHandlers starts executing.
AbstractServiceInvoker
  
complete(scope:IScope):void
The last method that trigger calls.
DelegateInvoker
 Inherited
createInnerHandlers(scope:IScope, innerType:String, actionList:Array, innerHandlersClass:Class = null):IActionList
Creates IActionList and sets the properties: debug, type, listeners, dispatcher and inheritScope in the newly IActionList (inner-handlers).
AbstractServiceInvoker
 Inherited
createInstance(scope:IScope):Object
Where the currentInstance is created using the generator class as the template, passing arguments to the constructor as specified by the constructorArgs (if any).
ServiceInvokerBuilder
  
createResponder(token:AsyncToken, dispatcher:EventDispatcher):Responder
Creates a responder for a given token.
DelegateInvoker
  
prepare(scope:IScope):void
The first method that trigger calls.
DelegateInvoker
  
run(scope:IScope):void
Where all the action occurs.
DelegateInvoker
 Inherited
setProperties(scope:IScope):void
Where all the properties are set into the currentInstance.
BaseAction
Property detail
argumentsproperty
arguments:*  [read-write]

The property arguments allows you to pass an Object or an Array of objects when calling the function defined in the property method. You can use an array to pass multiple arguments or use a simple Object if the signature of the method has only one parameter.

The default value is undefined.

Implementation
    public function get arguments():*
    public function set arguments(value:*):void
instanceproperty 
instance:*  [read-write]

The instance of the Delegate to use.

The default value is null.

Implementation
    public function get instance():*
    public function set instance(value:*):void
methodproperty 
method:String  [read-write]

The method attribute specifies what function to call on the delegate instance.

The default value is null.

Implementation
    public function get method():String
    public function set method(value:String):void
showBusyCursorproperty 
public var showBusyCursor:Boolean = false

If true, a busy cursor is displayed while a service is executing. The default value is false.

The default value is false.

tokenproperty 
protected var token:AsyncToken

Generated when making asynchronous RPC operations. The same object is available in the result and fault events in the token property.

Constructor detail
DelegateInvoker()constructor
public function DelegateInvoker()

Contructor

Method detail
complete()method
protected override function complete(scope:IScope):void

The last method that trigger calls. This is your last chance to perform any action before the IActionList calls the next IAction in the list.

Parameters
scope:IScope
createResponder()method 
protected function createResponder(token:AsyncToken, dispatcher:EventDispatcher):Responder

Creates a responder for a given token. When the responder is invoked, the data is converted into an event and dispatched by the dispatcher. This will then trigger the inner handlers since the dispatcher passed in will be the same dispatcher that the inner handlers are listening to.

Parameters
token:AsyncToken
 
dispatcher:EventDispatcher

Returns
Responder
prepare()method 
protected override function prepare(scope:IScope):void

The first method that trigger calls. Usually, this is where the currentInstance is created or set if needed. In this method you can also perform any code that must be done first.

Parameters
scope:IScope
run()method 
protected override function run(scope:IScope):void

Where all the action occurs. At this moment, the currentInstance is already instantiated and all the properties are already set.

Parameters
scope:IScope