public class FixedBackOffPolicy extends StatelessBackOffPolicy
BackOffPolicy
that pauses for a fixed period of
time before continuing. A pause is implemented using Thread.sleep(long)
.
setBackOffPeriod(long)
is thread-safe and it is safe to call
setBackOffPeriod(long)
during execution from multiple threads, however
this may cause a single retry operation to have pauses of different
intervals.Constructor and Description |
---|
FixedBackOffPolicy() |
Modifier and Type | Method and Description |
---|---|
protected void |
doBackOff()
Pause for the
setBackOffPeriod(long) . |
long |
getBackOffPeriod()
The backoff period in milliseconds.
|
void |
setBackOffPeriod(long backOffPeriod)
Set the back off period in milliseconds.
|
void |
setSleeper(Sleeper sleeper)
Public setter for the
Sleeper strategy. |
backOff, start
public void setSleeper(Sleeper sleeper)
Sleeper
strategy.sleeper
- the sleeper to set defaults to ObjectWaitSleeper
.public void setBackOffPeriod(long backOffPeriod)
public long getBackOffPeriod()
protected void doBackOff() throws BackOffInterruptedException
setBackOffPeriod(long)
.doBackOff
in class StatelessBackOffPolicy
BackOffInterruptedException
- if interrupted during sleep.Copyright © 2013 SpringSource. All rights reserved.