BATCH-798: Samples working again. TODO: refactor rollbackClassifier into the stateless execution API

This commit is contained in:
dsyer
2008-08-29 17:14:59 +00:00
parent 2ea0fe68cf
commit bd91d0c35e
6 changed files with 35 additions and 13 deletions

View File

@@ -448,6 +448,8 @@ public class RetryTemplate implements RetryOperations {
protected boolean shouldRethrow(RetryPolicy retryPolicy, RetryContext context, RetryState state) {
// Allow stateless behaviour to take over for certain exception types
if (rollbackClassifier != null) {
// TODO: remove this. Make it part of the stateful execution parameters?
// Then we wouldn't have to make assertions about the stateless case.
boolean rollback = rollbackClassifier.classify(context.getLastThrowable());
if (rollback && state == null && retryPolicy.canRetry(context)) {
throw new RetryException("Inconsistent configuration. The retry policy says we can retry but "