Class FutureResult<T>

java.lang.Object
de.knightsoftnet.gwtp.spring.client.rest.helper.FutureResult<T>
Type Parameters:
T - type of the result
All Implemented Interfaces:
com.google.gwt.user.client.rpc.AsyncCallback<T>

public class FutureResult<T> extends Object implements com.google.gwt.user.client.rpc.AsyncCallback<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 Details

    • FutureResult

      public FutureResult()
  • Method Details

    • 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(com.google.gwt.user.client.rpc.AsyncCallback<T> callback)
      add callback which is informed about changes.
      Parameters:
      callback - callback which is informed about changes
    • isDone

      public boolean isDone()
    • onFailure

      public void onFailure(Throwable exception)
      Specified by:
      onFailure in interface com.google.gwt.user.client.rpc.AsyncCallback<T>
    • onSuccess

      public void onSuccess(T response)
      Specified by:
      onSuccess in interface com.google.gwt.user.client.rpc.AsyncCallback<T>