RESOLVED - issue BATCH-486: Users must choose between skip and retry

Tweak the retry policy to account for fatal exceptions as well (they should not be retryable).
This commit is contained in:
dsyer
2008-03-28 12:14:45 +00:00
parent bfa98e3bdb
commit 0ada1fcaaa
4 changed files with 47 additions and 5 deletions

View File

@@ -68,6 +68,14 @@ public class SkipLimitStepFactoryBean extends SimpleStepFactoryBean {
this.fatalExceptionClasses = fatalExceptionClasses;
}
/**
* Protected getter for the fatal exceptions.
* @return the fatalExceptionClasses
*/
protected Class[] getFatalExceptionClasses() {
return fatalExceptionClasses;
}
/**
* Public setter for the {@link ItemKeyGenerator}. This is used to identify
* failed items so they can be skipped if encountered again, generally in

View File

@@ -119,6 +119,7 @@ public class StatefulRetryStepFactoryBean extends SkipLimitStepFactoryBean {
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy(retryLimit);
if (retryableExceptionClasses != null) {
retryPolicy.setRetryableExceptionClasses(retryableExceptionClasses);
retryPolicy.setFatalExceptionClasses(getFatalExceptionClasses());
}
// Co-ordinate the retry policy with the exception handler: