Class FutureResult<T>
- java.lang.Object
-
- de.knightsoftnet.validators.client.rest.helper.FutureResult<T>
-
- Type Parameters:
T- type of the result
- All Implemented Interfaces:
org.fusesource.restygwt.client.MethodCallback<T>
public class FutureResult<T> extends Object implements org.fusesource.restygwt.client.MethodCallback<T>
future result for asynchronous call caching. Based on RPC Future Result from http://stackoverflow.com/questions/34851180/how-to-cache-server-results-in-gwt-with-guava- Author:
- Manfred Tremmel
-
-
Constructor Summary
Constructors Constructor Description FutureResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCallback(org.fusesource.restygwt.client.MethodCallback<T> pcallback)add callback which is informed about changes.Tget()get result of the call.booleanisDone()voidonFailure(org.fusesource.restygwt.client.Method pmethod, Throwable pexception)voidonSuccess(org.fusesource.restygwt.client.Method pmethod, T presponse)
-
-
-
Method Detail
-
get
public T get() throws IllegalStateException
get result of the call.- Returns:
- result of call
- Throws:
IllegalStateException- if call isn't done.
-
addCallback
public void addCallback(org.fusesource.restygwt.client.MethodCallback<T> pcallback)
add callback which is informed about changes.- Parameters:
pcallback- callback which is informed about changes
-
isDone
public boolean isDone()
-
onFailure
public void onFailure(org.fusesource.restygwt.client.Method pmethod, Throwable pexception)- Specified by:
onFailurein interfaceorg.fusesource.restygwt.client.MethodCallback<T>
-
-