|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public Deferred
Base interface for all classes which handle actions asynchronously. An action may involve one or more operations, for example creating or updating a model resource, which in turn may involve one or more HTTP requests. The Deferred interface allows to trigger a callback after the entire action, i.e. all involved HTTP requests, is finished. Thus, the Deferred interface may be used to get the overall result of an action.
| Method Summary | |
|---|---|
Deferred |
setFinishedCallback(Object callback,
Object parameter,
Boolean verbose)
Sets the handler of the deferred action. |
Object |
start(Boolean sync)
Executes the deferred action and invokes the callback functions set with the deferred object after the action finished. |
| Method Detail |
|---|
Deferred setFinishedCallback(Object callback,
Object parameter,
Boolean verbose)
callback -
the callback function in either one of the following flavors: function(Object verboseFinishResult), where:verboseFinishResult =
{
resource: resource object or id string of the related resource,parameter: the parameter passed into setFinishedCallback,request:
{
statusCode: HTTP status code,responseText: server response text}} function(Object resource, int statusCode, Object parameter), where: resource: resource object or id string of the related resourcestatusCode: HTTP status codeparameter: the parameter passed into setFinishedCallbackparameter -
optional parameter to be passed on to the callback function; may be nullverbose -
flag to indicate if the callback function is invoked in verbose or non-verbose mode; optional, defaults to false
Object start(Boolean sync)
sync -
indicates if the deferred action is executed synchronously or asynchronously. Optional, defaults to true.
undefined, otherwise a resource object or id string of the related resource is returned.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||