Top Description Fields Constructors Methods
org.apache.tools.ant.util

public Class RetryHandler

extends Object
Class Inheritance
Imports
java.io.IOException, org.apache.tools.ant.Project, .Task

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.

Field Summary

Modifier and TypeField and Description
private int
private Task

Constructor Summary

AccessConstructor and Description
public
RetryHandler(int
how many times to retry
retriesAllowed
,
Task
the Ant task that is is executed from, used for logging only
task
)

Create a new RetryingHandler.

Method Summary

Modifier and TypeMethod and Description
public void
execute(Retryable
the code to execute
exe
,
String
some descriptive text for this piece of code, used for logging
desc
)

Execute the Retryable code with specified number of retries.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

retriesAllowedback to summary
private int retriesAllowed
taskback to summary
private Task task

Constructor Detail

RetryHandlerback to summary
public RetryHandler(int retriesAllowed, Task task)

Create a new RetryingHandler.

Parameters
retriesAllowed:int

how many times to retry

task:Task

the Ant task that is is executed from, used for logging only

Method Detail

executeback to summary
public void execute(Retryable exe, String desc) throws IOException

Execute the Retryable code with specified number of retries.

Parameters
exe:Retryable

the code to execute

desc:String

some descriptive text for this piece of code, used for logging

Exceptions
IOException:
if the number of retries has exceeded the allowed limit