public Object run(
      long clientCustomerId, final Object obj, final Method method, final Object[] args)
      throws Throwable {
    Callable<Object> callable =
        new Callable<Object>() {
          @Override
          public Object call() throws Exception {
            return method.invoke(obj, args);
          }
        };
    String actionDescription = method.getClass().getSimpleName() + "." + method.getName();
    ApiRetryHelper<Object> retryHelper =
        new ApiRetryHelper<Object>(clientCustomerId, callable, actionDescription, retryStrategy);

    try {
      return retryHelper.callWithRetries();
    } catch (ApiInvocationException e) {
      throw e.getCause();
    }
  }
public Object run ( long clientCustomerId , final Object obj , final Method method , final Object [ ] args ) throws Throwable { Callable < Object > callable = new Callable < Object > ( ) { @ Override public Object call ( ) throws Exception { return method . invoke ( obj , args ) ; } } ; String actionDescription = method . getClass ( ) . getSimpleName ( ) + "." + method . getName ( ) ; ApiRetryHelper < Object > retryHelper = new ApiRetryHelper < Object > ( clientCustomerId , callable , actionDescription , retryStrategy ) ; try { return retryHelper . callWithRetries ( ) ; } catch ( ApiInvocationException e ) { throw e . getCause ( ) ; } }
The core method for invoking AdWords API call and handling RateExceededError.

<p>To align with AdWords API services, it also throws ApiException and RemoteException.

@param clientCustomerId the client customer ID for invoking the call
@param obj the object being invoked in AdWords API call
@param method the AdWords API call to invoke
@param args the arguments used for the AdWords API call
@throws Throwable the encountered error
@return the result of running the AdWords API call