Interface AsyncProvider<T,F>

Type Parameters:
T - the type of the provided value
F - the type returned on failure

public interface AsyncProvider<T,F>
An object capable of providing an instance of type T asynchronously via Callback. For example, the instance might be created within a GWT.runAsync block using the following template:
      public void get(final Callback<T, Throwable> callback) {
        GWT.runAsync(new RunAsyncCallback() {
          public void onSuccess() {
            callback.onSuccess(javax.inject.Provider.get());
          }
          public void onFailure(Throwable ex) {
            callback.onFailure(ex);
          }
        }
      }
  
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    get(Callback<? super T,? super F> callback)
     
  • Method Details

    • get

      void get(Callback<? super T,? super F> callback)
      Parameters:
      callback - Callback used to pass the instance of T or an exception if there is an issue creating that instance.