RCPProxyImpl.java :  » GWT » gwtrpc4j » org » gwtrpc4j » Java Open Source

Java Open Source » GWT » gwtrpc4j 
gwtrpc4j » org » gwtrpc4j » RCPProxyImpl.java
package org.gwtrpc4j;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.rpc.RpcRequestBuilder;
import com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter;
import com.google.gwt.user.server.rpc.SerializationPolicyProvider;

public class RCPProxyImpl extends RpcServiceProxy {

  protected RCPProxyImpl(
      SerializationPolicyProvider serializationPolicyProvider,
      String moduleBaseURL, String remoteServiceRelativePath,
      String serializationPolicyStrongName) {
    super(serializationPolicyProvider, moduleBaseURL,
        remoteServiceRelativePath, serializationPolicyStrongName);
  }

  public <T extends Object> void invoke() {
    int invocationCount = 0;
    String methodName = "";
    String requestData = "gwt msg";
    RequestCallbackAdapter.ResponseReader typeReturn = RequestCallbackAdapter.ResponseReader.OBJECT;

    AsyncCallback<T> callback = new AsyncCallback<T>() {

      public void onSuccess(Object result) {

      }

      public void onFailure(Throwable caught) {

      }
    };
    RequestCallbackAdapter<T> rca = new RequestCallbackAdapter<T>(this,
        methodName, 1, callback,
        RequestCallbackAdapter.ResponseReader.OBJECT);

    doInvoke(typeReturn, methodName, invocationCount, requestData, callback);

  }

  @Override
  protected RpcRequestBuilder ensureRpcRequestBuilder() {
    return null;
  }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.