@Documented @Retention(value=RUNTIME) @Target(value=METHOD) public @interface RetryOnFailure
For example, this load() method will retry to load the URL
 content if it fails at the first attempts:
 
 @RetryOnFailure(attempts = 2)
 String load(URL url) throws IOException {
   return url.getContent().toString();
 }| Modifier and Type | Optional Element and Description | 
|---|---|
| int | attemptsHow many times to retry. | 
| long | delayDelay between attempts, in time units. | 
| boolean | randomizeShall the time between retries by randomized. | 
| Class<? extends Throwable>[] | typesWhen to retry (in case of what exception types). | 
| TimeUnit | unitTime units. | 
| boolean | verboseShall it be fully verbose (show full exception trace) or just
 exception message? | 
public abstract int attempts
public abstract long delay
public abstract TimeUnit unit
public abstract Class<? extends Throwable>[] types
public abstract boolean verbose
public abstract boolean randomize
Copyright © 2012–2014 jcabi.com. All rights reserved.