Package | couk.markstar.starrequests.requests |
Class | public class AbstractRequest |
Inheritance | AbstractRequest ![]() |
Implements | IRequest |
Subclasses | LoadXMLRequest, RequestBatchAsyncUtil, RequestBatchUtil |
Property | Defined 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 |
Method | Defined 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 |
Method | Defined By | ||
---|---|---|---|
cleanup():void
A cleanup function. | AbstractRequest | ||
dispatchFailed(message:String):void
Helper function for sending the failed signal. | AbstractRequest |
cancelled | property |
cancelled:ISignal
[read-only] The instance of the failed signal for this request
public function get cancelled():ISignal
protected function cancelledListener():void { // function implementation }
completed | property |
completed:ISignal
[read-only] The instance of the completed signal for this request. This should be implemented in subclasses.
public function get completed():ISignal
failed | property |
failed:ISignal
[read-only] The instance of the failed signal for this request
public function get failed():ISignal
protected function failedListener( message:String ):void { // function implementation }
progress | property |
progress:ISignal
[read-only] The instance of the progress signal for this request
public function get progress():ISignal
protected function progressListener( progress:Number ):void { // function implementation }
started | property |
started:ISignal
[read-only] The instance of the started signal for this request
public function get started():ISignal
protected function startedListener():void { // function implementation }
AbstractRequest | () | Constructor |
public function AbstractRequest()
The constructor instantiates the started, progress and failed signals. When subclassing ensure to call super().
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.