com.alarmpoint.integrationagent.exceptions.retriable
Class RetriableException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.alarmpoint.integrationagent.exceptions.retriable.RetriableException
- All Implemented Interfaces:
- java.io.Serializable
public class RetriableException
- extends java.lang.Exception
An exception wrapper with an associated retry policy. The retry policy is
applied against the input that caused the exception.
- See Also:
- Serialized Form
Constructor Summary |
RetriableException(java.lang.Throwable cause,
int maxAttempts,
long delayMillis)
A convenience constructor that wraps an exception with a retry policy
that has a maximum attempt limit and a fixed delay between retries. |
RetriableException(java.lang.Throwable cause,
RetryPolicy retryPolicy)
Wraps an exception with a retry policy. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
RetriableException
public RetriableException(java.lang.Throwable cause,
RetryPolicy retryPolicy)
- Wraps an exception with a retry policy.
- Parameters:
cause
- -
the wrapped exception; may be null if unknownretryPolicy
- -
the retryPolicy policy that should apply to the wrapped
exception; must be non-null
RetriableException
public RetriableException(java.lang.Throwable cause,
int maxAttempts,
long delayMillis)
- A convenience constructor that wraps an exception with a retry policy
that has a maximum attempt limit and a fixed delay between retries.
- Parameters:
cause
- -
the wrapped exception; may be null if unknownmaxAttempts
- -
the maximum number of attempts (first attempt and retries)
that will be allowed; must be >= 1delayMillis
- -
the miminum delay (in milliseconds) between each retry
attempt; must be >= 0 with 0 indicating no delay
getRetryPolicy
public RetryPolicy getRetryPolicy()
- Gets the retry policy that applies to the wrapped exception.
- Returns:
- a non-null
RetryPolicy