org.codegist.crest.handler
Interface RetryHandler

All Known Implementing Classes:
MaxAttemptRetryHandler, RefreshAuthorizationRetryHandler

@CRestComponent
public interface RetryHandler

RetryHandlers are responsible for deciding whether a request that have failed should be re-tried to not.

RetryHandlers are CRest Components.

Author:
laurent.gilles@codegist.org
See Also:
CRestComponent

Method Summary
 boolean retry(RequestException exception, int attemptNumber)
          Should return whether to retry or not the request.
 

Method Detail

retry

boolean retry(RequestException exception,
              int attemptNumber)
              throws Exception
Should return whether to retry or not the request.

Parameters:
exception - Failure reason
attemptNumber - current attempt number. Starts at 2, as the first attempt has already been consumed
Returns:
whether to retry or not
Throws:
Exception - Any exception


Copyright © 2011. All Rights Reserved.