Package org.apache.tools.ant.util
Class RetryHandler
- java.lang.Object
-
- org.apache.tools.ant.util.RetryHandler
-
public class RetryHandler extends java.lang.Object
A simple utility class to take a piece of code (that implementsRetryable
interface) and executes that with possibility to retry the execution in case of IOException.
-
-
Constructor Summary
Constructors Constructor Description RetryHandler(int retriesAllowed, Task task)
Create a new RetryingHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(Retryable exe, java.lang.String desc)
Execute theRetryable
code with specified number of retries.
-
-
-
Constructor Detail
-
RetryHandler
public RetryHandler(int retriesAllowed, Task task)
Create a new RetryingHandler.- Parameters:
retriesAllowed
- how many times to retrytask
- the Ant task that is is executed from, used for logging only
-
-
Method Detail
-
execute
public void execute(Retryable exe, java.lang.String desc) throws java.io.IOException
Execute theRetryable
code with specified number of retries.- Parameters:
exe
- the code to executedesc
- some descriptive text for this piece of code, used for logging- Throws:
java.io.IOException
- if the number of retries has exceeded the allowed limit
-
-