Packageorg.springextensions.actionscript.cairngorm.business
SVN browsingAbstractDataTranslatorAwareBusinessDelegate.as
FisheyeAbstractDataTranslatorAwareBusinessDelegate.as
Classpublic class AbstractDataTranslatorAwareBusinessDelegate
InheritanceAbstractDataTranslatorAwareBusinessDelegate Inheritance AbstractBusinessDelegate
ImplementsIDataTranslatorAware, mx.rpc.IResponder

Abstract implementation of a business delegate that can be assigned an IDataTranslator instance to do some initial data conversion before the delegate's result is sent back to it's initial responder.

Subclasses should use the addResponderToToken() method to intercept service calls

.


Example
  public function getProducts():void {
    var token:AsyncToken = service.getProducts();
    addResponderToToken(token);
  }
  

See also

org.springextensions.actionscript.cairngorm.business.IDataTranslator


Documentation reference: the idatatranslator interface


Public Properties
 PropertyDefined by
  dataTranslator : IDataTranslator
The specified IDataTranslator instance.
AbstractDataTranslatorAwareBusinessDelegate
 Inheritedresponder : IResponder
Returns the current IResponder iinstance for this delegate.
AbstractBusinessDelegate
 Inheritedservice : *
Returns the current service for this delegate.
AbstractBusinessDelegate
Public Methods
 MethodDefined by
  
AbstractDataTranslatorAwareBusinessDelegate(service:* = null, responder:IResponder = null, dataTranslator:IDataTranslator = null)
AbstractDataTranslatorAwareBusinessDelegate
  
fault(info:Object):void

Immediately returns the fault object back to the delegate's initial responder.

AbstractDataTranslatorAwareBusinessDelegate
  
result(data:Object):void

Sends the result of the IDataTranslator's translate() method back to the delegate's initial responder

AbstractDataTranslatorAwareBusinessDelegate
Protected Methods
 MethodDefined by
  
addResponderToToken(token:AsyncToken):void
If an IDataTranslator instance has been assigned to the current delegate than the current delegate will be added as a responder to the specified AsyncToken.
AbstractDataTranslatorAwareBusinessDelegate
Property detail
dataTranslatorproperty
dataTranslator:IDataTranslator  [read-write]

The specified IDataTranslator instance.

Implementation
    public function get dataTranslator():IDataTranslator
    public function set dataTranslator(value:IDataTranslator):void
Constructor detail
AbstractDataTranslatorAwareBusinessDelegate()constructor
public function AbstractDataTranslatorAwareBusinessDelegate(service:* = null, responder:IResponder = null, dataTranslator:IDataTranslator = null)

Parameters
service:* (default = null) — an IDataTranslator instance that will be used to convert the delegate's result
 
responder:IResponder (default = null)
 
dataTranslator:IDataTranslator (default = null)
Method detail
addResponderToToken()method
protected function addResponderToToken(token:AsyncToken):void

If an IDataTranslator instance has been assigned to the current delegate than the current delegate will be added as a responder to the specified AsyncToken. That way the delegate can intercept the service response and have its IDataTranslator instance convert it, befire it sends the result back to the delegate's initial responder.

Parameters
token:AsyncToken — The specified AsyncToken instance.
fault()method 
public function fault(info:Object):void

Immediately returns the fault object back to the delegate's initial responder.

Parameters
info:Object
result()method 
public function result(data:Object):void

Sends the result of the IDataTranslator's translate() method back to the delegate's initial responder

Parameters
data:Object

See also