Retrier
in
Norconex Commons Lang.@Deprecated public class RetriableExecutor extends Object
RetriableExecutor
is responsible for executing IRetriable
instances. Upon reaching the maximum number of retries allowed, it
will return the last exception encountered if there was one, or throw
a RuntimeException
if IRetriable
simply returned
false
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RERUN_ATTEMPTS
Deprecated.
Default maximum number of retries.
|
static long |
DEFAULT_RERUN_SLEEP_TIME
Deprecated.
Default wait time (milliseconds) between reruns.
|
Constructor and Description |
---|
RetriableExecutor()
Deprecated.
Creates a new instance of
RetriableExecutor using the default
maximum re-run attempts and default re-run wait time. |
RetriableExecutor(IExceptionFilter exceptionFilter)
Deprecated.
Creates a new instance of
RetriableExecutor which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
RetriableExecutor(IExceptionFilter exceptionFilter,
int maxRerunAttempts)
Deprecated.
Creates a new instance of
RetriableExecutor which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
RetriableExecutor(IExceptionFilter exceptionFilter,
int maxRerunAttempts,
long sleepTime)
Deprecated.
/**
Creates a new instance of
RetriableExecutor which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
RetriableExecutor(int maxRerunAttempts)
Deprecated.
Creates a new instance of
RetriableExecutor using the default
re-run wait time. |
RetriableExecutor(int maxRecoveryAttempts,
long sleepTime)
Deprecated.
Creates a new instance of
RetriableExecutor . |
Modifier and Type | Method and Description |
---|---|
void |
execute(IRetriable retriable)
Deprecated.
Runs the
IRetriable instance. |
public static final int DEFAULT_MAX_RERUN_ATTEMPTS
public static final long DEFAULT_RERUN_SLEEP_TIME
public RetriableExecutor()
RetriableExecutor
using the default
maximum re-run attempts and default re-run wait time.public RetriableExecutor(int maxRerunAttempts)
RetriableExecutor
using the default
re-run wait time.maxRerunAttempts
- maximum number of execution attemptspublic RetriableExecutor(int maxRecoveryAttempts, long sleepTime)
RetriableExecutor
.maxRecoveryAttempts
- maximum number of execution attemptssleepTime
- number of milliseconds to wait between each executionspublic RetriableExecutor(IExceptionFilter exceptionFilter)
RetriableExecutor
which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter
. Uses the default
maximum re-run attempts and default re-run wait time.exceptionFilter
- exception filterpublic RetriableExecutor(IExceptionFilter exceptionFilter, int maxRerunAttempts)
RetriableExecutor
which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter
. Uses the default re-run wait time.exceptionFilter
- exception filtermaxRerunAttempts
- maximum number of execution attemptspublic RetriableExecutor(IExceptionFilter exceptionFilter, int maxRerunAttempts, long sleepTime)
RetriableExecutor
which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter
.exceptionFilter
- exception filtermaxRerunAttempts
- maximum number of execution attemptssleepTime
- number of milliseconds to wait between each executionspublic void execute(IRetriable retriable) throws RetriableException
IRetriable
instance.retriable
- the code to runRetriableException
- wrapper around last exception encountered
or exeption thrown when max rerun attempts is reached.Copyright © 2007–2021 Norconex Inc.. All rights reserved.