AbortCountExceptionHandler

public class AbortCountExceptionHandler extends Object
implements ExceptionHandler

Exception handler that is configured with a count of allowable retries before forcing an abort.

This is similar to the ExponentialBackoffExceptionHandler except the wait time is constant.

Public Constructor Summary

AbortCountExceptionHandler(int maximumTries, long sleepDuration, TimeUnit sleepUnit)
Constructs an AbortCountExceptionHandler.

Public Method Summary

boolean
handleException(Exception e, int ntries)
Determines how to proceed when an exception is thrown.

Inherited Method Summary

Public Constructors

public AbortCountExceptionHandler (int maximumTries, long sleepDuration, TimeUnit sleepUnit)

Constructs an AbortCountExceptionHandler.

Parameters
maximumTries number of retries to take if the traversal encounters exceptions
sleepDuration the backoff time to wait between detected handler exceptions
sleepUnit the TimeUnit for sleepDuration

Public Methods

public boolean handleException (Exception e, int ntries)

Determines how to proceed when an exception is thrown.

Parameters
e occurring exception
ntries number of previous failures
Returns
  • true to retry, false to abort (or rethrow exception)
Throws
InterruptedException on interruption