org.springframework.batch.retry.backoff
Class StatelessBackOffPolicy

java.lang.Object
  extended by org.springframework.batch.retry.backoff.StatelessBackOffPolicy
All Implemented Interfaces:
BackOffPolicy
Direct Known Subclasses:
FixedBackOffPolicy, NoBackOffPolicy

public abstract class StatelessBackOffPolicy
extends Object
implements BackOffPolicy

Simple base class for BackOffPolicy implementations that maintain no state across invocations.

Author:
Rob Harrop, Dave Syer

Constructor Summary
StatelessBackOffPolicy()
           
 
Method Summary
 void backOff(BackOffContext backOffContext)
          Delegates directly to the doBackOff() method without passing on the BackOffContext argument which is not needed for stateless implementations.
protected abstract  void doBackOff()
          Sub-classes should implement this method to perform the actual back off.
 BackOffContext start(RetryContext status)
          Returns 'null'.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatelessBackOffPolicy

public StatelessBackOffPolicy()
Method Detail

backOff

public final void backOff(BackOffContext backOffContext)
                   throws BackOffInterruptedException
Delegates directly to the doBackOff() method without passing on the BackOffContext argument which is not needed for stateless implementations.

Specified by:
backOff in interface BackOffPolicy
Throws:
BackOffInterruptedException - if the attempt at back off is interrupted.

start

public BackOffContext start(RetryContext status)
Returns 'null'. Subclasses can add behaviour, e.g. initial sleep before first attempt.

Specified by:
start in interface BackOffPolicy
Parameters:
status - the current retry context, which might contain information that we can use to decide how to proceed.
Returns:
the implementation-specific BackOffContext or 'null'.

doBackOff

protected abstract void doBackOff()
                           throws BackOffInterruptedException
Sub-classes should implement this method to perform the actual back off.

Throws:
BackOffInterruptedException


Copyright © 2009 SpringSource. All Rights Reserved.