@Test public void testFailWithRemoteException() throws Throwable { when(mockService.invoke()).thenThrow(remoteException); thrown.expect(RemoteException.class); rateLimiter.run(TEST_CID, mockService, method, EMPTY_ARGS); }
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(); } }
ApiRateLimiter { 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(); } } }
ApiRateLimiter { 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(); } } ApiRateLimiter(ApiRetryStrategy retryStrategy); }
ApiRateLimiter { 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(); } } ApiRateLimiter(ApiRetryStrategy retryStrategy); Object run(
      long clientCustomerId, final Object obj, final Method method, final Object[] args); }
ApiRateLimiter { 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(); } } ApiRateLimiter(ApiRetryStrategy retryStrategy); Object run(
      long clientCustomerId, final Object obj, final Method method, final Object[] args);  }