Package de.galan.commons.util
Class Retryable
- java.lang.Object
-
- de.galan.commons.util.Retryable
-
public class Retryable extends Object
Invokes a Callable/ExceptionalRunnable until it runs without Exception the specified times of retries.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_WAIT_TIMEstatic longINFINITE
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> Vcall(Callable<V> callable)static Retryableinfinite()Retryablemessage(String msg)Retryableretries(long retries)static Retryableretry(long numberOfRetries)voidrun(ExceptionalRunnable runnable)RetryabletimeToWait(long millis)RetryabletimeToWait(String timeToWaitBetween)
-
-
-
Field Detail
-
DEFAULT_WAIT_TIME
public static final String DEFAULT_WAIT_TIME
- See Also:
- Constant Field Values
-
INFINITE
public static final long INFINITE
- See Also:
- Constant Field Values
-
-
Method Detail
-
retry
public static Retryable retry(long numberOfRetries)
-
infinite
public static Retryable infinite()
-
timeToWait
public Retryable timeToWait(long millis)
-
retries
public Retryable retries(long retries)
-
run
public void run(ExceptionalRunnable runnable) throws Exception
- Throws:
Exception
-
-