org.apache.sling.testing.tools.retry

## Class RetryLoop

- java.lang.Object
- - org.apache.sling.testing.tools.retry.RetryLoop

    public class RetryLoop
    extends Object

Convenience class for retrying tests until timeout or success.

### Nested Class Summary

Nested Classes
`static interface` `RetryLoop.Condition` Interface for conditions to check, isTrue will be called repeatedly until success or timeout

### Constructor Summary

Constructors
Constructor and Description
`RetryLoop(RetryLoop.Condition c, int timeoutSeconds, int intervalBetweenTriesMsec)` Retry Condition c until it returns true or timeout.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected long` `getRemainingTimeSeconds()`
`protected void` `onTimeout()` Called if the loop times out without success, just before failing
`protected void` `reportException(Throwable t)` Can be overridden to report Exceptions that happen in the retry loop

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

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

### Constructor Detail

#### RetryLoop

    public RetryLoop(RetryLoop.Condition c,
                     int timeoutSeconds,
                     int intervalBetweenTriesMsec)

Retry Condition c until it returns true or timeout. See `RetryLoop.Condition` for isTrue semantics.

### Method Detail

#### reportException

    protected void reportException(Throwable t)

Can be overridden to report Exceptions that happen in the retry loop

#### onTimeout

    protected void onTimeout()

Called if the loop times out without success, just before failing

#### getRemainingTimeSeconds

    protected long getRemainingTimeSeconds()