Class RetryTask
java.lang.Object
io.atlassian.fugue.retry.RetryTask
- All Implemented Interfaces:
Runnable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAn instance that does nothing before retrying and ignores exceptions that occur.RetryTask(Runnable task, int tries, ExceptionHandler handler) An instance that does nothing before retrying.RetryTask(Runnable task, int tries, ExceptionHandler handler, Runnable beforeRetry) Constructor for RetryTask. -
Method Summary
Modifier and TypeMethodDescriptionvoidrun()Attempt to run the wrapped Runnable tries number of times.
-
Field Details
-
retrySupplier
-
-
Constructor Details
-
RetryTask
An instance that does nothing before retrying and ignores exceptions that occur.- Parameters:
task- to run, must not be nulltries- number of times to attempt to run task, must be posititve
-
RetryTask
An instance that does nothing before retrying.- Parameters:
task- to run, must not be nulltries- number of times to attempt to run task, must be positivehandler- reacts to exceptions thrown by the wrapped task, must not be null
-
RetryTask
Constructor for RetryTask.
- Parameters:
task- to run, must not be nulltries- number of times to attempt to run task, must be positivehandler- reacts to exceptions thrown by the wrapped task, must not be nullbeforeRetry- runs before each retry, must not be null
-
-
Method Details
-
run
public void run()Attempt to run the wrapped Runnable tries number of times. Any exceptions thrown will be ignored until the number of attempts is reached. If the number of attempts is reached without success, the most recent exception to be thrown will be rethrown.
-