Packagecouk.markstar.starrequests.requests
Classpublic class AbstractRequest
InheritanceAbstractRequest Inheritance Object
Implements IRequest
Subclasses LoadXMLRequest, RequestBatchAsyncUtil, RequestBatchUtil



Public Properties
 PropertyDefined By
  cancelled : ISignal
[read-only] The instance of the failed signal for this request
AbstractRequest
  completed : ISignal
[read-only] The instance of the completed signal for this request.
AbstractRequest
  failed : ISignal
[read-only] The instance of the failed signal for this request
AbstractRequest
  progress : ISignal
[read-only] The instance of the progress signal for this request
AbstractRequest
  started : ISignal
[read-only] The instance of the started signal for this request
AbstractRequest
Public Methods
 MethodDefined By
  
The constructor instantiates the started, progress and failed signals.
AbstractRequest
  
cancel():void
Call this function to cancel the request.
AbstractRequest
  
send():void
Call this function to execute the request.
AbstractRequest
Protected Methods
 MethodDefined By
  
cleanup():void
A cleanup function.
AbstractRequest
  
dispatchFailed(message:String):void
Helper function for sending the failed signal.
AbstractRequest
Property Detail
cancelledproperty
cancelled:ISignal  [read-only]

The instance of the failed signal for this request


Implementation
    public function get cancelled():ISignal

Example
The following code demonstrates a listener for the cancelled signal:
           protected function cancelledListener():void
           {
           // function implementation
           }
           
completedproperty 
completed:ISignal  [read-only]

The instance of the completed signal for this request. This should be implemented in subclasses.


Implementation
    public function get completed():ISignal
failedproperty 
failed:ISignal  [read-only]

The instance of the failed signal for this request


Implementation
    public function get failed():ISignal

Example
The following code demonstrates a listener for the failed signal:
           protected function failedListener( message:String ):void
           {
           // function implementation
           }
           
progressproperty 
progress:ISignal  [read-only]

The instance of the progress signal for this request


Implementation
    public function get progress():ISignal

Example
The following code demonstrates a listener for the progress signal:
           protected function progressListener( progress:Number ):void
           {
           // function implementation
           }
           
startedproperty 
started:ISignal  [read-only]

The instance of the started signal for this request


Implementation
    public function get started():ISignal

Example
The following code demonstrates a listener for the started signal:
           protected function startedListener():void
           {
           // function implementation
           }
           
Constructor Detail
AbstractRequest()Constructor
public function AbstractRequest()

The constructor instantiates the started, progress and failed signals. When subclassing ensure to call super().

Method Detail
cancel()method
public function cancel():void

Call this function to cancel the request. The cleanup method is then executed. This method should be overridden in subclasses, but ensure to call super.cancel() when overriding. Note that it is recommended to call super.cancel at the end of the method in the subclass.

cleanup()method 
protected function cleanup():void

A cleanup function. All four signals have their listeners removed and are set to null. This method should be overridden in subclasses, but ensure to call super.cleanup() when overriding. Note that it is recommended to call super.cancel at the end of the method in the subclass.

dispatchFailed()method 
protected function dispatchFailed(message:String):void

Helper function for sending the failed signal. It dispatches the failed signal using the message supplied then runs the cleanup method.

Parameters

message:String — The failed message to dispatch

send()method 
public function send():void

Call this function to execute the request. The started and progress signals are both dispatched. This method should be overridden in subclasses, but ensure to call super.send() when overriding.