com.alarmpoint.integrationagent.exceptions.retriable
Interface DelayPolicy

All Known Subinterfaces:
RetryPolicy
All Known Implementing Classes:
AbstractRetryPolicy, ExponentialDelayPolicy, FixedDelayPolicy, MaxAttemptRetryPolicy, MaxTimeRetryPolicy

public interface DelayPolicy

An interface that represents a policy that computes the delay between retry attempts.


Method Summary
 long getDelay(int numAttempts, long lastDelay)
          Gets the minimum amount of time that must elapse before the next retry attempt.
 

Method Detail

getDelay

long getDelay(int numAttempts,
              long lastDelay)
Gets the minimum amount of time that must elapse before the next retry attempt.

Parameters:
numAttempts - - the number of previous attempts (including first attempt and retries); assumed to be >= 1
lastDelay - - the delay (in milliseconds) returned by the previous call to this method (i.e., with numAttempts-1); -1 if not previously code (i.e., when numAttempts==0
Returns:
a non-negative integer indicating the delay in milliseconds