org.springframework.batch.retry.backoff
Class FixedBackOffPolicy
java.lang.Object
org.springframework.batch.retry.backoff.StatelessBackOffPolicy
org.springframework.batch.retry.backoff.FixedBackOffPolicy
- All Implemented Interfaces:
- BackOffPolicy
public class FixedBackOffPolicy
- extends StatelessBackOffPolicy
Implementation of 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.
- Author:
- Rob Harrop, Dave Syer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedBackOffPolicy
public FixedBackOffPolicy()
setSleeper
public void setSleeper(Sleeper sleeper)
- Public setter for the
Sleeper
strategy.
- Parameters:
sleeper
- the sleeper to set defaults to ObjectWaitSleeper
.
setBackOffPeriod
public void setBackOffPeriod(long backOffPeriod)
- Set the back off period in milliseconds. Cannot be < 1. Default value
is 1000ms.
doBackOff
protected void doBackOff()
throws BackOffInterruptedException
- Pause for the
setBackOffPeriod(long)
.
- Specified by:
doBackOff
in class StatelessBackOffPolicy
- Throws:
BackOffInterruptedException
- if interrupted during sleep.
Copyright © 2009 SpringSource. All Rights Reserved.