|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.api.DefaultBackoffPolicy
public final class DefaultBackoffPolicy
A BackoffPolicy that does an 'exponential' backoff. So each next attempt, the calculated delay is increased
and randomized (so the next value can be smaller than the previous, but overall they will increase).
| Field Summary | |
|---|---|
static BackoffPolicy |
MAX_100_MS
|
| Constructor Summary | |
|---|---|
DefaultBackoffPolicy()
Creates an ExponentialBackoffPolicy with 100 nanoseconds as minimal delay and 100 milliseconds as maximum delay. |
|
DefaultBackoffPolicy(long minDelayNs)
Creates an ExponentialBackoffPolicy with given maximum delay. |
|
| Method Summary | |
|---|---|
protected long |
calcDelayNs(int attempt)
|
void |
delay(int attempt)
Delays the calling Thread. |
void |
delayUninterruptible(int attempt)
Delays the calling Thread without being interrupted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final BackoffPolicy MAX_100_MS
| Constructor Detail |
|---|
public DefaultBackoffPolicy()
public DefaultBackoffPolicy(long minDelayNs)
minDelayNs - the minimum delay in nanoseconds to wait. If a negative or zero value provided, it will be
interpreted that no external minimal value is needed.
NullPointerException - if unit is null.| Method Detail |
|---|
public void delay(int attempt)
throws InterruptedException
BackoffPolicyThe implementation is free to make this a no-op call.
delay in interface BackoffPolicyInterruptedExceptionpublic void delayUninterruptible(int attempt)
BackoffPolicyThe implementation is free to make this a no-op call.
delayUninterruptible in interface BackoffPolicyattempt - theprotected long calcDelayNs(int attempt)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||