All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sencha.gxt.data.client.loader.RpcProxy Maven / Gradle / Ivy

/**
 * Ext GWT 3.0.0-rc - Ext for GWT
 * Copyright(c) 2007-2011, Sencha, Inc.
 * [email protected]
 *
 * http://sencha.com/license
 */
package com.sencha.gxt.data.client.loader;

import com.google.gwt.core.client.Callback;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.sencha.gxt.data.shared.loader.DataProxy;

/**
 * DataProxy implementation that retrieves data using GWT RPC.
 * 
 * @param  the type of data used to configure the load from the proxy
 * @param  the type of data being returned by the data proxy
 */
public abstract class RpcProxy implements DataProxy {

  /**
   * Retrieves data using GWT RPC.
   * 
   * @param loadConfig the load config describing the data to retrieve
   * @param callback the callback to invoke on success or failure
   */
  public abstract void load(C loadConfig, AsyncCallback callback);

  @Override
  public final void load(C loadConfig, final Callback callback) {
    load(loadConfig, new AsyncCallback() {
      @Override
      public void onFailure(Throwable caught) {
        callback.onFailure(caught);
      }

      @Override
      public void onSuccess(D result) {
        callback.onSuccess(result);
      }
    });
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy