org.springframework.retry.policy
Class AlwaysRetryPolicy

java.lang.Object
  extended by org.springframework.retry.policy.NeverRetryPolicy
      extended by org.springframework.retry.policy.AlwaysRetryPolicy
All Implemented Interfaces:
RetryPolicy

public class AlwaysRetryPolicy
extends NeverRetryPolicy

A RetryPolicy that always permits a retry. Can also be used as a base class for other policies, e.g. for test purposes as a stub.

Author:
Dave Syer

Constructor Summary
AlwaysRetryPolicy()
           
 
Method Summary
 boolean canRetry(RetryContext context)
          Always returns true.
 
Methods inherited from class org.springframework.retry.policy.NeverRetryPolicy
close, open, registerThrowable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlwaysRetryPolicy

public AlwaysRetryPolicy()
Method Detail

canRetry

public boolean canRetry(RetryContext context)
Always returns true.

Specified by:
canRetry in interface RetryPolicy
Overrides:
canRetry in class NeverRetryPolicy
Parameters:
context - the current retry status
Returns:
true if the operation can proceed
See Also:
RetryPolicy.canRetry(org.springframework.retry.RetryContext)


Copyright © 2011 SpringSource. All Rights Reserved.