public class RetriableException
extends java.lang.Exception
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
RetryPolicy |
getRetryPolicy()
Gets the retry policy that applies to the wrapped exception.
|
public RetriableException(java.lang.Throwable cause, RetryPolicy retryPolicy)
cause
- -
the wrapped exception; may be null if unknownretryPolicy
- -
the retryPolicy policy that should apply to the wrapped
exception; must be non-nullpublic RetriableException(java.lang.Throwable cause, int maxAttempts, long delayMillis)
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 delaypublic RetryPolicy getRetryPolicy()
RetryPolicy