org.springframework.data.jdbc.retry
Class JdbcRetryPolicy

java.lang.Object
  extended by org.springframework.retry.policy.ExceptionClassifierRetryPolicy
      extended by org.springframework.data.jdbc.retry.JdbcRetryPolicy
All Implemented Interfaces:
org.springframework.retry.RetryPolicy

public class JdbcRetryPolicy
extends org.springframework.retry.policy.ExceptionClassifierRetryPolicy

JDBC specific implementation of a RetryPolicy that checks the Exception for clues to whether retry should be attempted or not.

Since:
1.0

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
JdbcRetryPolicy()
           
 
Method Summary
 boolean canRetry(org.springframework.retry.RetryContext retryContext)
          This gets called for any new invocation.
 int getMaxNumberOfRetries()
           
 Integer[] getRecoverableErrorCodes()
           
 void setMaxNumberOfRetries(int maxNumberOfRetries)
           
 void setRecoverableErrorCodes(Integer[] recoverableErrorCodes)
           
 
Methods inherited from class org.springframework.retry.policy.ExceptionClassifierRetryPolicy
close, open, registerThrowable, setExceptionClassifier, setPolicyMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

JdbcRetryPolicy

public JdbcRetryPolicy()
Method Detail

getRecoverableErrorCodes

public Integer[] getRecoverableErrorCodes()

setRecoverableErrorCodes

public void setRecoverableErrorCodes(Integer[] recoverableErrorCodes)

getMaxNumberOfRetries

public int getMaxNumberOfRetries()

setMaxNumberOfRetries

public void setMaxNumberOfRetries(int maxNumberOfRetries)

canRetry

public boolean canRetry(org.springframework.retry.RetryContext retryContext)
This gets called for any new invocation. Make sure that we haven't exceeded the max number of retries.

Specified by:
canRetry in interface org.springframework.retry.RetryPolicy
Overrides:
canRetry in class org.springframework.retry.policy.ExceptionClassifierRetryPolicy