RetryHandler (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util, class: RetryHandler

Package org.apache.tools.ant.util

# Class RetryHandler

java.lang.Object
org.apache.tools.ant.util.RetryHandler

public class RetryHandler extends Object
A simple utility class to take a piece of code (that implements `Retryable` 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

  Modifier and Type
  Method
  Description
  `void`
  `execute​(Retryable exe, String desc)`
  Execute the `Retryable` code with specified number of retries.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RetryHandler

    public RetryHandler​(int retriesAllowed, Task task)
    Create a new RetryingHandler.
    Parameters:
      `retriesAllowed` - how many times to retry
      `task` - the Ant task that is is executed from, used for logging only

- ## Method Details

  - ### execute

    public void execute​(Retryable exe, String desc) throws IOException
    Execute the `Retryable` code with specified number of retries.
    Parameters:
      `exe` - the code to execute
      `desc` - some descriptive text for this piece of code, used for logging
    Throws:
      `IOException` - if the number of retries has exceeded the allowed limit