|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.norconex.jef.exec.Rerunner
public class Rerunner
Rerunner
is responsible for executing IRerunnable
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 IRerunnable
simply returned
false
.
Field Summary | |
---|---|
static int |
DEFAULT_MAX_RERUN_ATTEMPTS
Default maximum number of retries. |
static long |
DEFAULT_RERUN_SLEEP_TIME
Default wait time (milliseconds) between reruns. |
Constructor Summary | |
---|---|
Rerunner()
Creates a new instance of Rerunner using the default
maximum re-run attempts and default re-run wait time. |
|
Rerunner(IExceptionFilter exceptionFilter)
Creates a new instance of Rerunner which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
|
Rerunner(IExceptionFilter exceptionFilter,
int maxRerunAttempts)
Creates a new instance of Rerunner which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
|
Rerunner(IExceptionFilter exceptionFilter,
int maxRerunAttempts,
long sleepTime)
/** Creates a new instance of Rerunner which will re-run code
triggering exceptions only if the given exception is accepted by
the IExceptionFilter . |
|
Rerunner(int maxRerunAttempts)
Creates a new instance of Rerunner using the default
re-run wait time. |
|
Rerunner(int maxRecoveryAttempts,
long sleepTime)
Creates a new instance of Rerunner . |
Method Summary | |
---|---|
void |
run(IRerunnable rerunnable)
Runs the IRerunnable instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_MAX_RERUN_ATTEMPTS
public static final long DEFAULT_RERUN_SLEEP_TIME
Constructor Detail |
---|
public Rerunner()
Rerunner
using the default
maximum re-run attempts and default re-run wait time.
public Rerunner(int maxRerunAttempts)
Rerunner
using the default
re-run wait time.
maxRerunAttempts
- maximum number of execution attemptspublic Rerunner(int maxRecoveryAttempts, long sleepTime)
Rerunner
.
maxRecoveryAttempts
- maximum number of execution attemptssleepTime
- number of milliseconds to wait between each executionspublic Rerunner(IExceptionFilter exceptionFilter)
Rerunner
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 Rerunner(IExceptionFilter exceptionFilter, int maxRerunAttempts)
Rerunner
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 Rerunner(IExceptionFilter exceptionFilter, int maxRerunAttempts, long sleepTime)
Rerunner
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 executionsMethod Detail |
---|
public void run(IRerunnable rerunnable) throws RerunnableException
IRerunnable
instance.
rerunnable
- the code to run
RerunnableException
- wrapper around last exception encountered
or exeption thrown when max rerun attempts is reached.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |