com.unclouded.android
Class Promise

java.lang.Object
  extended by com.unclouded.android.Promise

public class Promise
extends Object

Describes an object that acts as a proxy for a result that is initially unknown.

A Promise is returned as the result of a remote method invocation on a RemoteReference. Because remote method invocations are processed asynchronously (i.e. non blocking), a promise object is returned while awaiting for the return value. When this value is eventually returned, the Promise object is said to be resolved.

A Promise object accepts one or more PromiseListeners that are triggered when the promise is resolved.


Constructor Summary
Promise()
           
 
Method Summary
 String toString()
          Returns a string representation of a Promise object.
 void when(PromiseListener<? extends Serializable> listener)
          Install a PromiseListener to obtain the return value when the promise is resolved.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Promise

public Promise()
Method Detail

when

public void when(PromiseListener<? extends Serializable> listener)
Install a PromiseListener to obtain the return value when the promise is resolved.

Parameters:
listener - used to trigger a callback method when the promise is resolved.

toString

public String toString()
Returns a string representation of a Promise object.

Overrides:
toString in class Object
Returns:
a string representation of the promise.