Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gisgraphy.helper
Class RetryOnErrorTemplate<T>

    java.lang.Object
      com.gisgraphy.helper.RetryOnErrorTemplate<T>

    public abstract class RetryOnErrorTemplate<T>

extends Object

Give the ability to retry a function multiple times if it fails.
usage : ``

     RetryOnErrorTemplate<String> retryOnError = new RetryOnErrorTemplate<String>() {
                public String tryThat() throws Exception {
                    return THE_RETURNED_VALUE;
                }
            };
     retryOnError.times(3)

Author:
  David Masclet

Field Summary
`protected static org.slf4j.Logger` | `logger`

Constructor Summary
`RetryOnErrorTemplate()`

Method Summary
`int` | `getAlreadyTry()`
`String` | `getLoggingSentence()`
`int` | `getNumberOfTimesToRetry()`
`void` | `setLoggingSentence(String loggingSentence)`
`T` | `times(int numberOfTry)`
`abstract T` | `tryThat()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### logger

    protected static final org.slf4j.Logger logger

Constructor Detail

### RetryOnErrorTemplate

    public RetryOnErrorTemplate()

Method Detail

### tryThat

    public abstract T tryThat()
                       throws Exception

  Throws:
    `Exception`

### times

    public T times(int numberOfTry)
            throws Exception

  Throws:
    `Exception`

### getAlreadyTry

    public int getAlreadyTry()

  Returns:
    The number of times the code has already been try

### getNumberOfTimesToRetry

    public int getNumberOfTimesToRetry()

  Returns:
    The number of times the code should be try

### getLoggingSentence

    public String getLoggingSentence()

  Returns:
    the loggingSentence

### setLoggingSentence

    public void setLoggingSentence(String loggingSentence)

  Parameters:
    `loggingSentence` - the loggingSentence to set

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.