diff --git a/spring-batch-core/ivy.xml b/spring-batch-core/ivy.xml
index 15dc75608..b838e6552 100644
--- a/spring-batch-core/ivy.xml
+++ b/spring-batch-core/ivy.xml
@@ -39,8 +39,10 @@
+
+
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
index 23802f857..1600f8ba9 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBean.java
@@ -25,7 +25,6 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.aop.framework.Advised;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.Job;
import org.springframework.batch.core.Step;
@@ -58,15 +57,16 @@ import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.repeat.CompletionPolicy;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate;
-import org.springframework.batch.retry.RetryListener;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.batch.retry.backoff.BackOffPolicy;
-import org.springframework.batch.retry.policy.MapRetryContextCache;
-import org.springframework.batch.retry.policy.RetryContextCache;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.FactoryBean;
+import org.springframework.classify.BinaryExceptionClassifier;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
+import org.springframework.retry.RetryListener;
+import org.springframework.retry.RetryPolicy;
+import org.springframework.retry.backoff.BackOffPolicy;
+import org.springframework.retry.policy.MapRetryContextCache;
+import org.springframework.retry.policy.RetryContextCache;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java
index f9641a31a..8e995f956 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/BatchRetryTemplate.java
@@ -21,21 +21,21 @@ import java.util.Collection;
import java.util.Iterator;
import java.util.List;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.retry.ExhaustedRetryException;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryListener;
-import org.springframework.batch.retry.RetryOperations;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.batch.retry.RetryState;
-import org.springframework.batch.retry.backoff.BackOffPolicy;
-import org.springframework.batch.retry.context.RetryContextSupport;
-import org.springframework.batch.retry.policy.RetryContextCache;
-import org.springframework.batch.retry.support.DefaultRetryState;
-import org.springframework.batch.retry.support.RetrySynchronizationManager;
-import org.springframework.batch.retry.support.RetryTemplate;
+import org.springframework.classify.Classifier;
+import org.springframework.retry.ExhaustedRetryException;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryListener;
+import org.springframework.retry.RetryOperations;
+import org.springframework.retry.RetryPolicy;
+import org.springframework.retry.RetryState;
+import org.springframework.retry.backoff.BackOffPolicy;
+import org.springframework.retry.context.RetryContextSupport;
+import org.springframework.retry.policy.RetryContextCache;
+import org.springframework.retry.support.DefaultRetryState;
+import org.springframework.retry.support.RetrySynchronizationManager;
+import org.springframework.retry.support.RetryTemplate;
/**
* A special purpose retry template that deals specifically with multi-valued
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java
index 9b70190d8..608364cf5 100755
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessor.java
@@ -25,8 +25,8 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
-import org.springframework.batch.classify.Classifier;
+import org.springframework.classify.BinaryExceptionClassifier;
+import org.springframework.classify.Classifier;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy;
import org.springframework.batch.core.step.skip.NonSkippableProcessException;
@@ -35,12 +35,12 @@ import org.springframework.batch.core.step.skip.SkipListenerFailedException;
import org.springframework.batch.core.step.skip.SkipPolicy;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.retry.ExhaustedRetryException;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryException;
-import org.springframework.batch.retry.support.DefaultRetryState;
+import org.springframework.retry.ExhaustedRetryException;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryException;
+import org.springframework.retry.support.DefaultRetryState;
/**
* FaultTolerant implementation of the {@link ChunkProcessor} interface, that
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProvider.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProvider.java
index 7e6af16e6..e8fcf0e8a 100755
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProvider.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkProvider.java
@@ -16,8 +16,8 @@
package org.springframework.batch.core.step.item;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
-import org.springframework.batch.classify.Classifier;
+import org.springframework.classify.BinaryExceptionClassifier;
+import org.springframework.classify.Classifier;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy;
import org.springframework.batch.core.step.skip.NonSkippableReadException;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java
index bcfb8fa3d..1b276d603 100755
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java
@@ -23,9 +23,9 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.classify.SubclassClassifier;
+import org.springframework.classify.BinaryExceptionClassifier;
+import org.springframework.classify.Classifier;
+import org.springframework.classify.SubclassClassifier;
import org.springframework.batch.core.ChunkListener;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
@@ -45,17 +45,17 @@ import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.repeat.RepeatOperations;
import org.springframework.batch.repeat.support.RepeatTemplate;
-import org.springframework.batch.retry.ExhaustedRetryException;
-import org.springframework.batch.retry.RetryException;
-import org.springframework.batch.retry.RetryListener;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.batch.retry.backoff.BackOffPolicy;
-import org.springframework.batch.retry.policy.CompositeRetryPolicy;
-import org.springframework.batch.retry.policy.ExceptionClassifierRetryPolicy;
-import org.springframework.batch.retry.policy.MapRetryContextCache;
-import org.springframework.batch.retry.policy.NeverRetryPolicy;
-import org.springframework.batch.retry.policy.RetryContextCache;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
+import org.springframework.retry.ExhaustedRetryException;
+import org.springframework.retry.RetryException;
+import org.springframework.retry.RetryListener;
+import org.springframework.retry.RetryPolicy;
+import org.springframework.retry.backoff.BackOffPolicy;
+import org.springframework.retry.policy.CompositeRetryPolicy;
+import org.springframework.retry.policy.ExceptionClassifierRetryPolicy;
+import org.springframework.retry.policy.MapRetryContextCache;
+import org.springframework.retry.policy.NeverRetryPolicy;
+import org.springframework.retry.policy.RetryContextCache;
+import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.core.task.SyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.transaction.TransactionException;
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java
index d666ac20c..84cdd9b86 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandler.java
@@ -19,14 +19,14 @@ import java.util.Collection;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
+import org.springframework.classify.BinaryExceptionClassifier;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.exception.ExceptionHandler;
import org.springframework.batch.repeat.support.RepeatSynchronizationManager;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.batch.retry.listener.RetryListenerSupport;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryPolicy;
+import org.springframework.retry.listener.RetryListenerSupport;
/**
* An {@link ExceptionHandler} that is aware of the retry context so that it can
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/ExceptionClassifierSkipPolicy.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/ExceptionClassifierSkipPolicy.java
index 3f759138c..600324486 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/ExceptionClassifierSkipPolicy.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/ExceptionClassifierSkipPolicy.java
@@ -17,8 +17,8 @@ package org.springframework.batch.core.step.skip;
import java.util.Map;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.classify.SubclassClassifier;
+import org.springframework.classify.Classifier;
+import org.springframework.classify.SubclassClassifier;
/**
* A {@link SkipPolicy} that depends on an exception classifier to make its
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java
index dc545976b..ce1ab2d29 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java
@@ -19,8 +19,8 @@ import java.io.FileNotFoundException;
import java.util.Collections;
import java.util.Map;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
-import org.springframework.batch.classify.Classifier;
+import org.springframework.classify.BinaryExceptionClassifier;
+import org.springframework.classify.Classifier;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.item.file.FlatFileParseException;
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java
index 33d2edc66..1662547dc 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkElementParserTests.java
@@ -15,19 +15,27 @@
*/
package org.springframework.batch.core.configuration.xml;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Map;
+
import org.junit.Test;
-import org.springframework.batch.classify.SubclassClassifier;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.step.item.SimpleChunkProcessor;
import org.springframework.batch.core.step.skip.SkipPolicy;
import org.springframework.batch.core.step.tasklet.TaskletStep;
import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.support.CompositeItemStream;
-import org.springframework.batch.retry.RetryListener;
-import org.springframework.batch.retry.listener.RetryListenerSupport;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
import org.springframework.beans.PropertyAccessorUtils;
import org.springframework.beans.factory.BeanCreationException;
+import org.springframework.classify.SubclassClassifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
@@ -36,20 +44,12 @@ import org.springframework.dao.CannotSerializeTransactionException;
import org.springframework.dao.ConcurrencyFailureException;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.dao.PessimisticLockingFailureException;
+import org.springframework.retry.RetryListener;
+import org.springframework.retry.listener.RetryListenerSupport;
+import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.util.StringUtils;
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Map;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
/**
* @author Dan Garrette
* @author Dave Syer
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java
index 9e813e730..90f092a27 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/DummyRetryListener.java
@@ -1,8 +1,8 @@
package org.springframework.batch.core.configuration.xml;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryListener;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryListener;
/**
* @author Dan Garrette
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBeanTests.java
index 694d43ae7..744068aa4 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBeanTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserStepFactoryBeanTests.java
@@ -41,10 +41,10 @@ import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.file.FlatFileItemReader;
import org.springframework.batch.item.support.PassThroughItemProcessor;
import org.springframework.batch.repeat.support.TaskExecutorRepeatTemplate;
-import org.springframework.batch.retry.listener.RetryListenerSupport;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.SyncTaskExecutor;
+import org.springframework.retry.listener.RetryListenerSupport;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java
index b1a94a40e..5c1c1d829 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepParserTests.java
@@ -38,8 +38,8 @@ import org.springframework.batch.core.listener.StepExecutionListenerSupport;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.core.repository.support.SimpleJobRepository;
import org.springframework.batch.core.step.AbstractStep;
-import org.springframework.batch.core.step.item.FatalSkippableException;
import org.springframework.batch.core.step.item.FatalRuntimeException;
+import org.springframework.batch.core.step.item.FatalSkippableException;
import org.springframework.batch.core.step.item.ForceRollbackForWriteSkipException;
import org.springframework.batch.core.step.item.SkippableException;
import org.springframework.batch.core.step.item.SkippableRuntimeException;
@@ -49,14 +49,14 @@ import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.support.CompositeItemStream;
import org.springframework.batch.repeat.CompletionPolicy;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
-import org.springframework.batch.retry.RetryListener;
-import org.springframework.batch.retry.listener.RetryListenerSupport;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.dao.DeadlockLoserDataAccessException;
+import org.springframework.retry.RetryListener;
+import org.springframework.retry.listener.RetryListenerSupport;
import org.springframework.test.util.ReflectionTestUtils;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests.java
index 6b00c7d4b..395404f31 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests.java
@@ -28,9 +28,9 @@ import org.springframework.batch.core.JobParameters;
import org.springframework.batch.core.StepListener;
import org.springframework.batch.core.repository.JobRepository;
import org.springframework.batch.item.ItemStream;
-import org.springframework.batch.retry.RetryListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
+import org.springframework.retry.RetryListener;
import org.springframework.scheduling.concurrent.ConcurrentTaskExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java
index 29a3b4fe3..5a2c4b4b6 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TestRetryListener.java
@@ -1,8 +1,8 @@
package org.springframework.batch.core.configuration.xml;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryListener;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryListener;
public class TestRetryListener extends AbstractTestComponent implements RetryListener {
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java
index 8812b6bf9..360b4e939 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/BatchRetryTemplateTests.java
@@ -10,13 +10,13 @@ import java.util.Collections;
import java.util.List;
import org.junit.Test;
-import org.springframework.batch.retry.ExhaustedRetryException;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryState;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
-import org.springframework.batch.retry.support.DefaultRetryState;
+import org.springframework.retry.ExhaustedRetryException;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryState;
+import org.springframework.retry.policy.SimpleRetryPolicy;
+import org.springframework.retry.support.DefaultRetryState;
public class BatchRetryTemplateTests {
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java
index dac7a3d27..a08506083 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkProcessorTests.java
@@ -11,7 +11,6 @@ import java.util.List;
import org.junit.Before;
import org.junit.Test;
-import org.springframework.batch.classify.BinaryExceptionClassifier;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepContribution;
import org.springframework.batch.core.StepExecution;
@@ -21,10 +20,11 @@ import org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.support.PassThroughItemProcessor;
-import org.springframework.batch.retry.RetryException;
-import org.springframework.batch.retry.policy.NeverRetryPolicy;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
+import org.springframework.classify.BinaryExceptionClassifier;
import org.springframework.dao.DataIntegrityViolationException;
+import org.springframework.retry.RetryException;
+import org.springframework.retry.policy.NeverRetryPolicy;
+import org.springframework.retry.policy.SimpleRetryPolicy;
public class FaultTolerantChunkProcessorTests {
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java
index 6a6c1091c..ec204823f 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBeanRetryTests.java
@@ -52,10 +52,10 @@ import org.springframework.batch.item.ItemStream;
import org.springframework.batch.item.ItemWriter;
import org.springframework.batch.item.support.AbstractItemCountingItemStreamItemReader;
import org.springframework.batch.item.support.ListItemReader;
-import org.springframework.batch.retry.policy.MapRetryContextCache;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
import org.springframework.batch.support.transaction.TransactionAwareProxyFactory;
+import org.springframework.retry.policy.MapRetryContextCache;
+import org.springframework.retry.policy.SimpleRetryPolicy;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.StringUtils;
diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandlerTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandlerTests.java
index 1d2ca4564..75991dfac 100644
--- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandlerTests.java
+++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleRetryExceptionHandlerTests.java
@@ -24,10 +24,10 @@ import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextSupport;
import org.springframework.batch.repeat.exception.SimpleLimitExceptionHandler;
import org.springframework.batch.repeat.support.RepeatSynchronizationManager;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.batch.retry.policy.AlwaysRetryPolicy;
-import org.springframework.batch.retry.policy.NeverRetryPolicy;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.RetryPolicy;
+import org.springframework.retry.policy.AlwaysRetryPolicy;
+import org.springframework.retry.policy.NeverRetryPolicy;
/**
* @author Dave Syer
diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml
index 4aa058fa1..41db9e3e9 100644
--- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml
+++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml
@@ -19,7 +19,7 @@
-
diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml
index d0a439238..cb5b6587c 100644
--- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml
+++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml
@@ -101,7 +101,7 @@
-
+
diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml
index 01b9e727c..54370499f 100644
--- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml
+++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml
@@ -15,7 +15,7 @@
-
+
@@ -24,16 +24,16 @@
-
+
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
index fcab1f027..1c9daf5f2 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
+++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/container/jms/BatchMessageListenerContainerIntegrationTests.java
@@ -34,12 +34,12 @@ import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.policy.NeverRetryPolicy;
-import org.springframework.batch.retry.support.DefaultRetryState;
-import org.springframework.batch.retry.support.RetryTemplate;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.policy.NeverRetryPolicy;
+import org.springframework.retry.support.DefaultRetryState;
+import org.springframework.retry.support.RetryTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.test.context.ContextConfiguration;
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
index 16cbc7ee4..d9f54c31f 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
+++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/jms/ExternalRetryInBatchTests.java
@@ -35,15 +35,15 @@ import org.springframework.batch.repeat.RepeatStatus;
import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.batch.repeat.support.RepeatSynchronizationManager;
import org.springframework.batch.repeat.support.RepeatTemplate;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.policy.SimpleRetryPolicy;
-import org.springframework.batch.retry.support.DefaultRetryState;
-import org.springframework.batch.retry.support.RetryTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jms.core.JmsTemplate;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.policy.SimpleRetryPolicy;
+import org.springframework.retry.support.DefaultRetryState;
+import org.springframework.retry.support.RetryTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.PlatformTransactionManager;
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
index e6c6c1d54..a7c076bee 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
+++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/ExternalRetryTests.java
@@ -30,14 +30,14 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.ItemReader;
import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.retry.RecoveryCallback;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.support.DefaultRetryState;
-import org.springframework.batch.retry.support.RetryTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jms.core.JmsTemplate;
+import org.springframework.retry.RecoveryCallback;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.support.DefaultRetryState;
+import org.springframework.retry.support.RetryTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.PlatformTransactionManager;
diff --git a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
index aaacb8b44..ba1285270 100644
--- a/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
+++ b/spring-batch-infrastructure-tests/src/test/java/org/springframework/batch/retry/jms/SynchronousTests.java
@@ -31,12 +31,12 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.item.jms.JmsItemReader;
import org.springframework.batch.jms.ExternalRetryInBatchTests;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.support.RetryTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.simple.SimpleJdbcTemplate;
import org.springframework.jms.core.JmsTemplate;
+import org.springframework.retry.RetryCallback;
+import org.springframework.retry.RetryContext;
+import org.springframework.retry.support.RetryTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.transaction.AfterTransaction;
diff --git a/spring-batch-infrastructure/ivy.xml b/spring-batch-infrastructure/ivy.xml
index 5e12c6ce3..d3d974737 100644
--- a/spring-batch-infrastructure/ivy.xml
+++ b/spring-batch-infrastructure/ivy.xml
@@ -47,6 +47,7 @@
+
diff --git a/spring-batch-infrastructure/pom.xml b/spring-batch-infrastructure/pom.xml
index 369931b5c..e429bcf43 100644
--- a/spring-batch-infrastructure/pom.xml
+++ b/spring-batch-infrastructure/pom.xml
@@ -201,6 +201,10 @@
spring-ormtrue
+
+ org.springframework.retry
+ spring-retry
+ org.springframeworkspring-test
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BackToBackPatternClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BackToBackPatternClassifier.java
deleted file mode 100644
index a2cb385f5..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BackToBackPatternClassifier.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.classify;
-
-import java.util.Map;
-
-/**
- * A special purpose {@link Classifier} with easy configuration options for
- * mapping from one arbitrary type of object to another via a pattern matcher.
- *
- * @author Dave Syer
- *
- */
-public class BackToBackPatternClassifier implements Classifier {
-
- private Classifier router;
-
- private Classifier matcher;
-
- /**
- * Default constructor, provided as a convenience for people using setter
- * injection.
- */
- public BackToBackPatternClassifier() {
- }
-
- /**
- * Set up a classifier with input to the router and output from the matcher.
- *
- * @param router see {@link #setRouterDelegate(Object)}
- * @param matcher see {@link #setMatcherMap(Map)}
- */
- public BackToBackPatternClassifier(Classifier router, Classifier matcher) {
- super();
- this.router = router;
- this.matcher = matcher;
- }
-
- /**
- * A convenience method for creating a pattern matching classifier for the
- * matcher component.
- *
- * @param map maps pattern keys with wildcards to output values
- */
- public void setMatcherMap(Map map) {
- this.matcher = new PatternMatchingClassifier(map);
- }
-
- /**
- * A convenience method of creating a router classifier based on a plain old
- * Java Object. The object provided must have precisely one public method
- * that either has the @Classifier annotation or accepts a single argument
- * and outputs a String. This will be used to create an input classifier for
- * the router component.
- *
- * @param delegate the delegate object used to create a router classifier
- */
- public void setRouterDelegate(Object delegate) {
- this.router = new ClassifierAdapter(delegate);
- }
-
- /**
- * Classify the input and map to a String, then take that and put it into a
- * pattern matcher to match to an output value.
- */
- public T classify(C classifiable) {
- return matcher.classify(router.classify(classifiable));
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BinaryExceptionClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BinaryExceptionClassifier.java
deleted file mode 100644
index d206b80ff..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/BinaryExceptionClassifier.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.classify;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * A {@link Classifier} for exceptions that has only two classes (true and
- * false). Classifies objects according to their inheritance relation with the
- * supplied types. If the object to be classified is one of the provided types,
- * or is a subclass of one of the types, then the non-default value is returned
- * (usually true).
- *
- * @see SubclassClassifier
- *
- * @author Dave Syer
- *
- */
-public class BinaryExceptionClassifier extends SubclassClassifier {
-
- /**
- * Create a binary exception classifier with the provided default value.
- *
- * @param defaultValue defaults to false
- */
- public BinaryExceptionClassifier(boolean defaultValue) {
- super(defaultValue);
- }
-
- /**
- * Create a binary exception classifier with the provided classes and their
- * subclasses. The mapped value for these exceptions will be the one
- * provided (which will be the opposite of the default).
- *
- * @param value
- */
- public BinaryExceptionClassifier(Collection> exceptionClasses, boolean value) {
- this(!value);
- if (exceptionClasses != null) {
- Map, Boolean> map = new HashMap, Boolean>();
- for (Class extends Throwable> type : exceptionClasses) {
- map.put(type, !getDefault());
- }
- setTypeMap(map);
- }
- }
-
- /**
- * Create a binary exception classifier with the default value false and
- * value mapping true for the provided classes and their subclasses.
- */
- public BinaryExceptionClassifier(Collection> exceptionClasses) {
- this(exceptionClasses, true);
- }
-
- /**
- * Create a binary exception classifier using the given classification map
- * and a default classification of false.
- *
- * @param typeMap
- */
- public BinaryExceptionClassifier(Map, Boolean> typeMap) {
- this(typeMap, false);
- }
-
- /**
- * Create a binary exception classifier using the given classification map
- * and a default classification of false.
- *
- * @param typeMap
- */
- public BinaryExceptionClassifier(Map, Boolean> typeMap, boolean defaultValue) {
- super(typeMap, defaultValue);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/Classifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/Classifier.java
deleted file mode 100644
index 3b937b3c9..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/Classifier.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.classify;
-
-/**
- * Interface for a classifier. At its simplest a {@link Classifier} is just a
- * map from objects of one type to objects of another type.
- *
- * @author Dave Syer
- *
- */
-public interface Classifier {
-
- /**
- * Classify the given object and return an object of a different type,
- * possibly an enumerated type.
- *
- * @param classifiable the input object. Can be null.
- * @return an object. Can be null, but implementations should declare if
- * this is the case.
- */
- T classify(C classifiable);
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierAdapter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierAdapter.java
deleted file mode 100644
index 6eba544a3..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierAdapter.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.classify;
-
-import org.springframework.batch.support.MethodInvoker;
-import org.springframework.batch.support.MethodInvokerUtils;
-import org.springframework.util.Assert;
-
-/**
- * Wrapper for an object to adapt it to the {@link Classifier} interface.
- *
- * @author Dave Syer
- *
- */
-public class ClassifierAdapter implements Classifier {
-
- private MethodInvoker invoker;
-
- private Classifier classifier;
-
- /**
- * Default constructor for use with setter injection.
- */
- public ClassifierAdapter() {
- super();
- }
-
- /**
- * Create a new {@link Classifier} from the delegate provided. Use the
- * constructor as an alternative to the {@link #setDelegate(Object)} method.
- *
- * @param delegate
- */
- public ClassifierAdapter(Object delegate) {
- setDelegate(delegate);
- }
-
- /**
- * Create a new {@link Classifier} from the delegate provided. Use the
- * constructor as an alternative to the {@link #setDelegate(Classifier)}
- * method.
- *
- * @param delegate
- */
- public ClassifierAdapter(Classifier delegate) {
- classifier = delegate;
- }
-
- public void setDelegate(Classifier delegate) {
- classifier = delegate;
- invoker = null;
- }
-
- /**
- * Search for the
- * {@link org.springframework.batch.support.annotation.Classifier
- * Classifier} annotation on a method in the supplied delegate and use that
- * to create a {@link Classifier} from the parameter type to the return
- * type. If the annotation is not found a unique non-void method with a
- * single parameter will be used, if it exists. The signature of the method
- * cannot be checked here, so might be a runtime exception when the method
- * is invoked if the signature doesn't match the classifier types.
- *
- * @param delegate an object with an annotated method
- */
- public final void setDelegate(Object delegate) {
- classifier = null;
- invoker = MethodInvokerUtils.getMethodInvokerByAnnotation(
- org.springframework.batch.support.annotation.Classifier.class, delegate);
- if (invoker == null) {
- invoker = MethodInvokerUtils. getMethodInvokerForSingleArgument(delegate);
- }
- Assert.state(invoker != null, "No single argument public method with or without "
- + "@Classifier was found in delegate of type " + delegate.getClass());
- }
-
- /**
- * {@inheritDoc}
- */
- @SuppressWarnings("unchecked")
- public T classify(C classifiable) {
- if (classifier != null) {
- return classifier.classify(classifiable);
- }
- return (T) invoker.invokeMethod(classifiable);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierSupport.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierSupport.java
deleted file mode 100644
index ad2926378..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/ClassifierSupport.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.classify;
-
-/**
- * Base class for {@link Classifier} implementations. Provides default behaviour
- * and some convenience members, like constants.
- *
- * @author Dave Syer
- *
- */
-public class ClassifierSupport implements Classifier {
-
- final private T defaultValue;
-
- /**
- * @param defaultValue
- */
- public ClassifierSupport(T defaultValue) {
- super();
- this.defaultValue = defaultValue;
- }
-
- /**
- * Always returns the default value. This is the main extension point for
- * subclasses, so it must be able to classify null.
- *
- * @see org.springframework.batch.classify.Classifier#classify(Object)
- */
- public T classify(C throwable) {
- return defaultValue;
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/PatternMatchingClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/PatternMatchingClassifier.java
deleted file mode 100644
index 11d483517..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/PatternMatchingClassifier.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.classify;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.springframework.batch.support.PatternMatcher;
-
-/**
- * A {@link Classifier} that maps from String patterns with wildcards to a set
- * of values of a given type. An input String is matched with the most specific
- * pattern possible to the corresponding value in an input map. A default value
- * should be specified with a pattern key of "*".
- *
- * @author Dave Syer
- *
- */
-public class PatternMatchingClassifier implements Classifier {
-
- private PatternMatcher values;
-
- /**
- * Default constructor. Use the setter or the other constructor to create a
- * sensible classifier, otherwise all inputs will cause an exception.
- */
- public PatternMatchingClassifier() {
- this(new HashMap());
- }
-
- /**
- * Create a classifier from the provided map. The keys are patterns, using
- * '?' as a single character and '*' as multi-character wildcard.
- *
- * @param values
- */
- public PatternMatchingClassifier(Map values) {
- super();
- this.values = new PatternMatcher(values);
- }
-
- /**
- * A map from pattern to value
- * @param values the pattern map to set
- */
- public void setPatternMap(Map values) {
- this.values = new PatternMatcher(values);
- }
-
- /**
- * Classify the input by matching it against the patterns provided in
- * {@link #setPatternMap(Map)}. The most specific pattern that matches will
- * be used to locate a value.
- *
- * @return the value matching the most specific pattern possible
- *
- * @throws IllegalStateException if no matching value is found.
- */
- public T classify(String classifiable) {
- T value = values.match(classifiable);
- return value;
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/SubclassClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/SubclassClassifier.java
deleted file mode 100644
index ef2910d44..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/classify/SubclassClassifier.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.classify;
-
-import java.io.Serializable;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * A {@link Classifier} for a parameterised object type based on a map.
- * Classifies objects according to their inheritance relation with the supplied
- * type map. If the object to be classified is one of the keys of the provided
- * map, or is a subclass of one of the keys, then the map entry value for that
- * key is returned. Otherwise returns the default value which is null by
- * default.
- *
- * @author Dave Syer
- *
- */
-public class SubclassClassifier implements Classifier {
-
- private ConcurrentMap, C> classified = new ConcurrentHashMap, C>();
-
- private C defaultValue = null;
-
- /**
- * Create a {@link SubclassClassifier} with null default value.
- *
- */
- public SubclassClassifier() {
- this(null);
- }
-
- /**
- * Create a {@link SubclassClassifier} with supplied default value.
- *
- * @param defaultValue
- */
- public SubclassClassifier(C defaultValue) {
- this(new HashMap, C>(), defaultValue);
- }
-
- /**
- * Create a {@link SubclassClassifier} with supplied default value.
- *
- * @param defaultValue
- */
- public SubclassClassifier(Map, C> typeMap, C defaultValue) {
- super();
- this.classified = new ConcurrentHashMap, C>(typeMap);
- this.defaultValue = defaultValue;
- }
-
- /**
- * Public setter for the default value for mapping keys that are not found
- * in the map (or their subclasses). Defaults to false.
- *
- * @param defaultValue the default value to set
- */
- public void setDefaultValue(C defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- /**
- * Set the classifications up as a map. The keys are types and these will be
- * mapped along with all their subclasses to the corresponding value. The
- * most specific types will match first.
- *
- * @param map a map from type to class
- */
- public void setTypeMap(Map, C> map) {
- this.classified = new ConcurrentHashMap, C>(map);
- }
-
- /**
- * Return the value from the type map whose key is the class of the given
- * Throwable, or its nearest ancestor if a subclass.
- *
- */
- public C classify(T classifiable) {
-
- if (classifiable == null) {
- return defaultValue;
- }
-
- @SuppressWarnings("unchecked")
- Class extends T> exceptionClass = (Class extends T>) classifiable.getClass();
- if (classified.containsKey(exceptionClass)) {
- return classified.get(exceptionClass);
- }
-
- // check for subclasses
- Set> classes = new TreeSet>(new ClassComparator());
- classes.addAll(classified.keySet());
- for (Class extends T> cls : classes) {
- if (cls.isAssignableFrom(exceptionClass)) {
- C value = classified.get(cls);
- this.classified.put(exceptionClass, value);
- return value;
- }
- }
-
- return defaultValue;
- }
-
- /**
- * Return the default value supplied in the constructor (default false).
- */
- final public C getDefault() {
- return defaultValue;
- }
-
- /**
- * Comparator for classes to order by inheritance.
- *
- * @author Dave Syer
- *
- */
- private static class ClassComparator implements Comparator>, Serializable {
- /**
- * @return 1 if arg0 is assignable from arg1, -1 otherwise
- * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
- */
- public int compare(Class> arg0, Class> arg1) {
- if (arg0.isAssignableFrom(arg1)) {
- return 1;
- }
- return -1;
- }
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodArgumentsKeyGenerator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodArgumentsKeyGenerator.java
index dff7e575b..b7c099d55 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodArgumentsKeyGenerator.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodArgumentsKeyGenerator.java
@@ -20,7 +20,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.batch.retry.interceptor.MethodArgumentsKeyGenerator;
+import org.springframework.retry.interceptor.MethodArgumentsKeyGenerator;
/**
* A {@link MethodArgumentsKeyGenerator} for JMS
@@ -34,7 +34,7 @@ public class JmsMethodArgumentsKeyGenerator implements MethodArgumentsKeyGenerat
* If the message is a {@link Message} then returns the JMS message ID.
* Otherwise just return the first argument.
*
- * @see org.springframework.batch.retry.interceptor.MethodArgumentsKeyGenerator#getKey(Object[])
+ * @see org.springframework.retry.interceptor.MethodArgumentsKeyGenerator#getKey(Object[])
*
* @throws UnexpectedInputException if the JMS id cannot be determined from
* a JMS Message
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodInvocationRecoverer.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodInvocationRecoverer.java
index 836259757..03c087d0b 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodInvocationRecoverer.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsMethodInvocationRecoverer.java
@@ -17,7 +17,7 @@ package org.springframework.batch.item.jms;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.retry.interceptor.MethodInvocationRecoverer;
+import org.springframework.retry.interceptor.MethodInvocationRecoverer;
import org.springframework.jms.JmsException;
import org.springframework.jms.core.JmsOperations;
@@ -44,7 +44,7 @@ public class JmsMethodInvocationRecoverer implements MethodInvocationRecovere
* Send one message per item in the arguments list using the default destination of
* the jms template. If the recovery is successful null is returned.
*
- * @see org.springframework.batch.retry.interceptor.MethodInvocationRecoverer#recover(Object[],
+ * @see org.springframework.retry.interceptor.MethodInvocationRecoverer#recover(Object[],
* Throwable)
*/
public T recover(Object[] items, Throwable cause) {
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsNewMethodArgumentsIdentifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsNewMethodArgumentsIdentifier.java
index eb37701f4..2cfb61a87 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsNewMethodArgumentsIdentifier.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/jms/JmsNewMethodArgumentsIdentifier.java
@@ -20,7 +20,7 @@ import javax.jms.JMSException;
import javax.jms.Message;
import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.batch.retry.interceptor.NewMethodArgumentsIdentifier;
+import org.springframework.retry.interceptor.NewMethodArgumentsIdentifier;
/**
* A {@link NewMethodArgumentsIdentifier} for JMS that looks for a message in
@@ -35,7 +35,7 @@ public class JmsNewMethodArgumentsIdentifier implements NewMethodArgumentsIde
* If any of the arguments is a message, check the JMS re-delivered flag and
* return it, otherwise return false to be on the safe side.
*
- * @see org.springframework.batch.retry.interceptor.NewMethodArgumentsIdentifier#isNew(java.lang.Object[])
+ * @see org.springframework.retry.interceptor.NewMethodArgumentsIdentifier#isNew(java.lang.Object[])
*/
public boolean isNew(Object[] args) {
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java
index 44688e254..a3fa648c7 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/item/support/ClassifierCompositeItemWriter.java
@@ -21,8 +21,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.classify.ClassifierSupport;
+import org.springframework.classify.Classifier;
+import org.springframework.classify.ClassifierSupport;
import org.springframework.batch.item.ItemWriter;
/**
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
index 0ede464a4..f50997f4e 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/LogOrRethrowExceptionHandler.java
@@ -18,8 +18,8 @@ package org.springframework.batch.repeat.exception;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.classify.ClassifierSupport;
+import org.springframework.classify.Classifier;
+import org.springframework.classify.ClassifierSupport;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.RepeatException;
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java
index 521daefdd..8ffe0e0b7 100644
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java
+++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/repeat/exception/RethrowOnThresholdExceptionHandler.java
@@ -22,8 +22,8 @@ import java.util.Map.Entry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.classify.Classifier;
-import org.springframework.batch.classify.SubclassClassifier;
+import org.springframework.classify.Classifier;
+import org.springframework.classify.SubclassClassifier;
import org.springframework.batch.repeat.RepeatContext;
import org.springframework.batch.repeat.context.RepeatContextCounter;
import org.springframework.util.ObjectUtils;
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/ExhaustedRetryException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/ExhaustedRetryException.java
deleted file mode 100644
index 82c658114..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/ExhaustedRetryException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-public class ExhaustedRetryException extends RetryException {
-
- public ExhaustedRetryException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- public ExhaustedRetryException(String msg) {
- super(msg);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RecoveryCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RecoveryCallback.java
deleted file mode 100644
index 27ce5b00a..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RecoveryCallback.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.retry;
-
-/**
- * Callback for stateful retry after all tries are exhausted.
- *
- * @author Dave Syer
- *
- * @since 1.1
- */
-public interface RecoveryCallback {
-
- /**
- * @param context the current retry context
- * @return an Object that can be used to replace the callback result that
- * failed
- * @throws Exception
- */
- T recover(RetryContext context) throws Exception;
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryCallback.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryCallback.java
deleted file mode 100644
index 88d863517..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryCallback.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-/**
- * Callback interface for an operation that can be retried using a
- * {@link RetryOperations}.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public interface RetryCallback {
-
- /**
- * Execute an operation with retry semantics. Operations should generally be
- * idempotent, but implementations may choose to implement compensation
- * semantics when an operation is retried.
- * @param context the current retry context.
- * @return the result of the successful operation.
- * @throws Exception if processing fails
- */
- T doWithRetry(RetryContext context) throws Exception;
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryContext.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryContext.java
deleted file mode 100644
index 8242aa027..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryContext.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-import org.springframework.core.AttributeAccessor;
-
-/**
- * Low-level access to ongoing retry operation. Normally not needed by clients,
- * but can be used to alter the course of the retry, e.g. force an early
- * termination.
- *
- * @author Dave Syer
- *
- */
-public interface RetryContext extends AttributeAccessor {
-
- /**
- * Signal to the framework that no more attempts should be made to try or
- * retry the current {@link RetryCallback}.
- */
- void setExhaustedOnly();
-
- /**
- * Public accessor for the exhausted flag {@link #setExhaustedOnly()}.
- *
- * @return true if the flag has been set.
- */
- boolean isExhaustedOnly();
-
- /**
- * Accessor for the parent context if retry blocks are nested.
- *
- * @return the parent or null if there is none.
- */
- RetryContext getParent();
-
- /**
- * Counts the number of retry attempts. Before the first attempt this
- * counter is zero, and before the first and subsequent attempts it should
- * increment accordingly.
- *
- * @return the number of retries.
- */
- int getRetryCount();
-
- /**
- * Accessor for the exception object that caused the current retry.
- *
- * @return the last exception that caused a retry, or possibly null. It will
- * be null if this is the first attempt, but also if the enclosing policy
- * decides not to provide it (e.g. because of concerns about memory usage).
- */
- Throwable getLastThrowable();
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryException.java
deleted file mode 100644
index 8f436f629..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-import org.springframework.core.NestedRuntimeException;
-
-public class RetryException extends NestedRuntimeException {
-
- public RetryException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- public RetryException(String msg) {
- super(msg);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryListener.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryListener.java
deleted file mode 100644
index 0eceaff0a..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-
-/**
- * Interface for listener that can be used to add behaviour to a retry.
- * Implementations of {@link RetryOperations} can chose to issue callbacks to an
- * interceptor during the retry lifecycle.
- *
- * @author Dave Syer
- *
- */
-public interface RetryListener {
-
- /**
- * Called before the first attempt in a retry. For instance, implementers
- * can set up state that is needed by the policies in the
- * {@link RetryOperations}. The whole retry can be vetoed by returning
- * false from this method, in which case a {@link TerminatedRetryException}
- * will be thrown.
- *
- * @param context the current {@link RetryContext}.
- * @param callback the current {@link RetryCallback}.
- * @return true if the retry should proceed.
- */
- boolean open(RetryContext context, RetryCallback callback);
-
- /**
- * Called after the final attempt (successful or not). Allow the interceptor
- * to clean up any resource it is holding before control returns to the
- * retry caller.
- *
- * @param context the current {@link RetryContext}.
- * @param callback the current {@link RetryCallback}.
- * @param throwable the last exception that was thrown by the callback.
- */
- void close(RetryContext context, RetryCallback callback, Throwable throwable);
-
- /**
- * Called after every unsuccessful attempt at a retry.
- *
- * @param context the current {@link RetryContext}.
- * @param callback the current {@link RetryCallback}.
- * @param throwable the last exception that was thrown by the callback.
- */
- void onError(RetryContext context, RetryCallback callback, Throwable throwable);
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryOperations.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryOperations.java
deleted file mode 100644
index 158987dcd..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryOperations.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-import org.springframework.batch.retry.support.DefaultRetryState;
-
-/**
- * Defines the basic set of operations implemented by {@link RetryOperations} to
- * execute operations with configurable retry behaviour.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public interface RetryOperations {
-
- /**
- * Execute the supplied {@link RetryCallback} with the configured retry
- * semantics. See implementations for configuration details.
- *
- * @return the value returned by the {@link RetryCallback} upon successful
- * invocation.
- * @throws Exception any {@link Exception} raised by the
- * {@link RetryCallback} upon unsuccessful retry.
- */
- T execute(RetryCallback retryCallback) throws Exception;
-
- /**
- * Execute the supplied {@link RetryCallback} with a fallback on exhausted
- * retry to the {@link RecoveryCallback}. See implementations for
- * configuration details.
- *
- * @return the value returned by the {@link RetryCallback} upon successful
- * invocation, and that returned by the {@link RecoveryCallback} otherwise.
- * @throws Exception any {@link Exception} raised by the
- * {@link RecoveryCallback} upon unsuccessful retry.
- */
- T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback) throws Exception;
-
- /**
- * A simple stateful retry. Execute the supplied {@link RetryCallback} with
- * a target object for the attempt identified by the {@link DefaultRetryState}.
- * Exceptions thrown by the callback are always propagated immediately so
- * the state is required to be able to identify the previous attempt, if
- * there is one - hence the state is required. Normal patterns would see
- * this method being used inside a transaction, where the callback might
- * invalidate the transaction if it fails.
- *
- * See implementations for configuration details.
- *
- * @return the value returned by the {@link RetryCallback} upon successful
- * invocation, and that returned by the {@link RecoveryCallback} otherwise.
- * @throws Exception any {@link Exception} raised by the
- * {@link RecoveryCallback}.
- * @throws ExhaustedRetryException if the last attempt for this state has
- * already been reached
- */
- T execute(RetryCallback retryCallback, RetryState retryState) throws Exception, ExhaustedRetryException;
-
- /**
- * A stateful retry with a recovery path. Execute the supplied
- * {@link RetryCallback} with a fallback on exhausted retry to the
- * {@link RecoveryCallback} and a target object for the retry attempt
- * identified by the {@link DefaultRetryState}.
- *
- * @see #execute(RetryCallback, RetryState)
- *
- * @return the value returned by the {@link RetryCallback} upon successful
- * invocation, and that returned by the {@link RecoveryCallback} otherwise.
- * @throws Exception any {@link Exception} raised by the
- * {@link RecoveryCallback} upon unsuccessful retry.
- */
- T execute(RetryCallback retryCallback, RecoveryCallback recoveryCallback, RetryState retryState)
- throws Exception;
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryPolicy.java
deleted file mode 100644
index c22b17216..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryPolicy.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-/**
- * A {@link RetryPolicy} is responsible for allocating and managing resources
- * needed by {@link RetryOperations}. The {@link RetryPolicy} allows retry
- * operations to be aware of their context. Context can be internal to the retry
- * framework, e.g. to support nested retries. Context can also be external, and
- * the {@link RetryPolicy} provides a uniform API for a range of different
- * platforms for the external context.
- *
- * @author Dave Syer
- *
- */
-public interface RetryPolicy {
-
- /**
- * @param context the current retry status
- * @return true if the operation can proceed
- */
- boolean canRetry(RetryContext context);
-
- /**
- * Acquire resources needed for the retry operation. The callback is passed
- * in so that marker interfaces can be used and a manager can collaborate
- * with the callback to set up some state in the status token.
- * @param parent the parent context if we are in a nested retry.
- *
- * @return a {@link RetryContext} object specific to this manager.
- *
- */
- RetryContext open(RetryContext parent);
-
- /**
- * @param context a retry status created by the
- * {@link #open(RetryContext)} method of this manager.
- */
- void close(RetryContext context);
-
- /**
- * Called once per retry attempt, after the callback fails.
- *
- * @param context the current status object.
- *
- */
- void registerThrowable(RetryContext context, Throwable throwable);
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryState.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryState.java
deleted file mode 100644
index 0dee88f99..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryState.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.retry;
-
-/**
- * Stateful retry is characterised by having to recognise the items that are
- * being processed, so this interface is used primarily to provide a cache key in
- * between failed attempts. It also provides a hints to the
- * {@link RetryOperations} for optimisations to do with avoidable cache hits and
- * switching to stateless retry if a rollback is not needed.
- *
- * @author Dave Syer
- *
- */
-public interface RetryState {
-
- /**
- * Key representing the state for a retry attempt. Stateful retry is
- * characterised by having to recognise the items that are being processed,
- * so this value is used as a cache key in between failed attempts.
- *
- * @return the key that this state represents
- */
- Object getKey();
-
- /**
- * Indicate whether a cache lookup can be avoided. If the key is known ahead
- * of the retry attempt to be fresh (i.e. has never been seen before) then a
- * cache lookup can be avoided if this flag is true.
- *
- * @return true if the state does not require an explicit check for the key
- */
- boolean isForceRefresh();
-
- /**
- * Check whether this exception requires a rollback. The default is always
- * true, which is conservative, so this method provides an optimisation for
- * switching to stateless retry if there is an exception for which rollback
- * is unnecessary. Example usage would be for a stateful retry to specify a
- * validation exception as not for rollback.
- *
- * @param exception the exception that caused a retry attempt to fail
- * @return true if this exception should cause a rollback
- */
- boolean rollbackFor(Throwable exception);
-
-}
\ No newline at end of file
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryStatistics.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryStatistics.java
deleted file mode 100644
index caf352a80..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/RetryStatistics.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-/**
- * Interface for statistics reporting of retry attempts. Counts the number of
- * retry attempts, successes, errors (including retries), and aborts.
- *
- * @author Dave Syer
- *
- */
-public interface RetryStatistics {
-
- /**
- * @return the number of completed retry attempts (successful or not).
- */
- int getCompleteCount();
-
- /**
- * Get the number of times a retry block has been entered, irrespective of
- * how many times the operation was retried.
- *
- * @return the number of retry blocks started.
- */
- int getStartedCount();
-
- /**
- * Get the number of errors detected, whether or not they resulted in a
- * retry.
- *
- * @return the number of errors detected.
- */
- int getErrorCount();
-
- /**
- * Get the number of times a block failed to complete successfully, even
- * after retry.
- *
- * @return the number of retry attempts that failed overall.
- */
- int getAbortCount();
-
- /**
- * Get an identifier for the retry block for reporting purposes.
- *
- * @return an identifier for the block.
- */
- String getName();
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/TerminatedRetryException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/TerminatedRetryException.java
deleted file mode 100644
index 65d376ec0..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/TerminatedRetryException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry;
-
-public class TerminatedRetryException extends RetryException {
-
- public TerminatedRetryException(String msg, Throwable cause) {
- super(msg, cause);
- }
-
- public TerminatedRetryException(String msg) {
- super(msg);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffContext.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffContext.java
deleted file mode 100644
index 3a070f46b..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffContext.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-/**
- * @author Rob Harrop
- * @since 2.1
- */
-public interface BackOffContext {
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffInterruptedException.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffInterruptedException.java
deleted file mode 100644
index 7b43d1d24..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffInterruptedException.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-import org.springframework.batch.retry.RetryException;
-
-/**
- * Exception class signifiying that an attempt to back off using a
- * {@link BackOffPolicy} was interrupted, most likely by an
- * {@link InterruptedException} during a call to {@link Thread#sleep(long)}.
- *
- * @author Rob Harrop
- * @since 2.1
- */
-public class BackOffInterruptedException extends RetryException {
-
- public BackOffInterruptedException(String msg) {
- super(msg);
- }
-
- public BackOffInterruptedException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffPolicy.java
deleted file mode 100644
index 980a82583..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/BackOffPolicy.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-import org.springframework.batch.retry.RetryContext;
-
-/**
- * Strategy interface to control back off between attempts in a single
- * {@link org.springframework.batch.retry.support.RetryTemplate retry operation}.
- * Implementations are expected to be thread-safe and should be designed
- * for concurrent access. Configuration for each implementation is also expected
- * to be thread-safe but need not be suitable for high load concurrent access.
- * For each block of retry operations the {@link #start} method is called
- * and implementations can return an implementation-specific
- * {@link BackOffContext} that can be used to track state through subsequent
- * back off invocations. Each back off process is handled via a call to
- * {@link #backOff}. The
- * {@link org.springframework.batch.retry.support.RetryTemplate} will pass in
- * the corresponding {@link BackOffContext} object created by the call to
- * {@link #start}.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public interface BackOffPolicy {
-
- /**
- * Start a new block of back off operations. Implementations can choose to
- * pause when this method is called, but normally it returns immediately.
- *
- * @param context the current retry context, which might contain information
- * that we can use to decide how to proceed.
- * @return the implementation-specific {@link BackOffContext} or 'null'.
- */
- BackOffContext start(RetryContext context);
-
- /**
- * Back off/pause in an implementation-specific fashion. The passed in
- * {@link BackOffContext} corresponds to the one created by the call to
- * {@link #start} for a given retry operation set.
- *
- * @throws BackOffInterruptedException if the attempt at back off is
- * interrupted.
- */
- void backOff(BackOffContext backOffContext) throws BackOffInterruptedException;
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ExponentialBackOffPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ExponentialBackOffPolicy.java
deleted file mode 100644
index 594d2dafe..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ExponentialBackOffPolicy.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.util.ClassUtils;
-
-/**
- * Implementation of {@link BackOffPolicy} that increases the back off period
- * for each retry attempt in a given set using the {@link Math#exp(double)
- * exponential} function.
- *
- * This implementation is thread-safe and suitable for concurrent access.
- * Modifications to the configuration do not affect any retry sets that are
- * already in progress.
- *
- * The {@link #setInitialInterval(long)} property controls the initial value
- * passed to {@link Math#exp(double)} and the {@link #setMultiplier(double)}
- * property controls by how much this value is increased for each subsequent
- * attempt.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public class ExponentialBackOffPolicy implements BackOffPolicy {
-
- /**
- * The default 'initialInterval' value - 100 millisecs. Coupled with the
- * default 'multiplier' value this gives a useful initial spread of pauses
- * for 1-5 retries.
- */
- public static final long DEFAULT_INITIAL_INTERVAL = 100L;
-
- /**
- * The default maximum backoff time (30 seconds).
- */
- public static final long DEFAULT_MAX_INTERVAL = 30000L;
-
- /**
- * The default 'multiplier' value - value 2 (100% increase per backoff).
- */
- public static final double DEFAULT_MULTIPLIER = 2;
-
- /**
- * The initial sleep interval.
- */
- private volatile long initialInterval = DEFAULT_INITIAL_INTERVAL;
-
- /**
- * The maximum value of the backoff period in milliseconds.
- */
- private volatile long maxInterval = DEFAULT_MAX_INTERVAL;
-
- /**
- * The value to increment the exp seed with for each retry attempt.
- */
- private volatile double multiplier = DEFAULT_MULTIPLIER;
-
- private Sleeper sleeper = new ObjectWaitSleeper();
-
- /**
- * Public setter for the {@link Sleeper} strategy.
- * @param sleeper the sleeper to set defaults to {@link ObjectWaitSleeper}.
- */
- public void setSleeper(Sleeper sleeper) {
- this.sleeper = sleeper;
- }
-
- /**
- * Set the initial sleep interval value. Default is 100
- * millisecond. Cannot be set to a value less than one.
- */
- public void setInitialInterval(long initialInterval) {
- this.initialInterval = (initialInterval > 1 ? initialInterval : 1);
- }
-
- /**
- * Set the multiplier value. Default is '2.0'. Hint: do not use
- * values much in excess of 1.0 (or the backoff will get very long very
- * fast).
- */
- public void setMultiplier(double multiplier) {
- this.multiplier = (multiplier > 1.0 ? multiplier : 1.0);
- }
-
- /**
- * Setter for maximum back off period. Default is 30000 (30 seconds). the
- * value will be reset to 1 if this method is called with a value less than
- * 1. Set this to avoid infinite waits if backing off a large number of
- * times (or if the multiplier is set too high).
- *
- * @param maxInterval in milliseconds.
- */
- public void setMaxInterval(long maxInterval) {
- this.maxInterval = maxInterval > 0 ? maxInterval : 1;
- }
-
- /**
- * The initial period to sleep on the first backoff.
- * @return the initial interval
- */
- public long getInitialInterval() {
- return initialInterval;
- }
-
- /**
- * The maximum interval to sleep for. Defaults to 30 seconds.
- *
- * @return the maximum interval.
- */
- public long getMaxInterval() {
- return maxInterval;
- }
-
- /**
- * The multiplier to use to generate the next backoff interval from the
- * last.
- *
- * @return the multiplier in use
- */
- public double getMultiplier() {
- return multiplier;
- }
-
- /**
- * Returns a new instance of {@link BackOffContext} configured with the
- * 'expSeed' and 'increment' values.
- */
- public BackOffContext start(RetryContext context) {
- return new ExponentialBackOffContext(this.initialInterval, this.multiplier, this.maxInterval);
- }
-
- /**
- * Pause for a length of time equal to '
- * exp(backOffContext.expSeed)'.
- */
- public void backOff(BackOffContext backOffContext) throws BackOffInterruptedException {
- ExponentialBackOffContext context = (ExponentialBackOffContext) backOffContext;
- try {
- sleeper.sleep(context.getSleepAndIncrement());
- }
- catch (InterruptedException e) {
- throw new BackOffInterruptedException("Thread interrupted while sleeping", e);
- }
- }
-
- private static class ExponentialBackOffContext implements BackOffContext {
-
- private final double multiplier;
-
- private long interval;
-
- private long maxInterval;
-
- public ExponentialBackOffContext(long expSeed, double multiplier, long maxInterval) {
- this.interval = expSeed;
- this.multiplier = multiplier;
- this.maxInterval = maxInterval;
- }
-
- public synchronized long getSleepAndIncrement() {
- long sleep = this.interval;
- if (sleep > maxInterval) {
- sleep = (long) maxInterval;
- }
- else {
- this.interval *= this.multiplier;
- }
- return sleep;
- }
- }
-
- public String toString() {
- return ClassUtils.getShortName(getClass()) + "[initialInterval=" + initialInterval + ", multiplier="
- + multiplier + ", maxInterval=" + maxInterval + "]";
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/FixedBackOffPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/FixedBackOffPolicy.java
deleted file mode 100644
index cfdd0eb05..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/FixedBackOffPolicy.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-
-/**
- * Implementation of {@link BackOffPolicy} that pauses for a fixed period of
- * time before continuing. A pause is implemented using {@link Thread#sleep(long)}.
- * {@link #setBackOffPeriod(long)} is thread-safe and it is safe to call
- * {@link #setBackOffPeriod} during execution from multiple threads, however
- * this may cause a single retry operation to have pauses of different
- * intervals.
- * @author Rob Harrop
- * @author Dave Syer
- */
-public class FixedBackOffPolicy extends StatelessBackOffPolicy {
-
- /**
- * Default back off period - 1000ms.
- */
- private static final long DEFAULT_BACK_OFF_PERIOD = 1000L;
-
- /**
- * The back off period in milliseconds. Defaults to 1000ms.
- */
- private volatile long backOffPeriod = DEFAULT_BACK_OFF_PERIOD;
-
-
- private Sleeper sleeper = new ObjectWaitSleeper();
-
- /**
- * Public setter for the {@link Sleeper} strategy.
- * @param sleeper the sleeper to set defaults to {@link ObjectWaitSleeper}.
- */
- public void setSleeper(Sleeper sleeper) {
- this.sleeper = sleeper;
- }
-
- /**
- * Set the back off period in milliseconds. Cannot be < 1. Default value
- * is 1000ms.
- */
- public void setBackOffPeriod(long backOffPeriod) {
- this.backOffPeriod = (backOffPeriod > 0 ? backOffPeriod : 1);
- }
-
- /**
- * The backoff period in milliseconds.
- * @return the backoff period
- */
- public long getBackOffPeriod() {
- return backOffPeriod;
- }
-
- /**
- * Pause for the {@link #setBackOffPeriod(long)}.
- * @throws BackOffInterruptedException if interrupted during sleep.
- */
- protected void doBackOff() throws BackOffInterruptedException {
- try {
- sleeper.sleep(backOffPeriod);
- }
- catch (InterruptedException e) {
- throw new BackOffInterruptedException("Thread interrupted while sleeping", e);
- }
- }
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/NoBackOffPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/NoBackOffPolicy.java
deleted file mode 100644
index ae85ccc2f..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/NoBackOffPolicy.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-
-/**
- * Implementation of {@link BackOffPolicy} that performs a no-op and as such all
- * retry operation in a given set proceed one after the other with no pause.
- *
- * @author Rob Harrop
- * @since 2.1
- */
-public class NoBackOffPolicy extends StatelessBackOffPolicy {
-
- protected void doBackOff() throws BackOffInterruptedException {
- }
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ObjectWaitSleeper.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ObjectWaitSleeper.java
deleted file mode 100644
index 254b43a67..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/ObjectWaitSleeper.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.retry.backoff;
-
-/**
- * Simple {@link Sleeper} implementation that just waits on a local Object.
- *
- * @author Dave Syer
- *
- */
-public class ObjectWaitSleeper implements Sleeper {
-
- /*
- * (non-Javadoc)
- * @see org.springframework.batch.retry.backoff.Sleeper#sleep(long)
- */
- public void sleep(long backOffPeriod) throws InterruptedException {
- Object mutex = new Object();
- synchronized (mutex) {
- mutex.wait(backOffPeriod);
- }
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/Sleeper.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/Sleeper.java
deleted file mode 100644
index d547b4163..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/Sleeper.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.retry.backoff;
-
-/**
- * Strategy interface for backoff policies to delegate the pausing of execution.
- *
- * @author Dave Syer
- *
- */
-public interface Sleeper {
-
- /**
- * Pause for the specified period using whatever means available.
- *
- * @param backOffPeriod
- */
- void sleep(long backOffPeriod) throws InterruptedException;
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/StatelessBackOffPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/StatelessBackOffPolicy.java
deleted file mode 100644
index 836459e74..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/StatelessBackOffPolicy.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.backoff;
-
-import org.springframework.batch.retry.RetryContext;
-
-/**
- * Simple base class for {@link BackOffPolicy} implementations that maintain no
- * state across invocations.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public abstract class StatelessBackOffPolicy implements BackOffPolicy {
-
- /**
- * Delegates directly to the {@link #doBackOff()} method without passing on
- * the {@link BackOffContext} argument which is not needed for stateless
- * implementations.
- */
- public final void backOff(BackOffContext backOffContext) throws BackOffInterruptedException {
- doBackOff();
- }
-
- /**
- * Returns 'null'. Subclasses can add behaviour, e.g.
- * initial sleep before first attempt.
- */
- public BackOffContext start(RetryContext status) {
- return null;
- }
-
- /**
- * Sub-classes should implement this method to perform the actual back off.
- */
- protected abstract void doBackOff() throws BackOffInterruptedException;
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/package.html b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/package.html
deleted file mode 100644
index 53837ce90..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/backoff/package.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-Infrastructure implementations of retry backoff concerns.
-
-
-
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/RetryContextSupport.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/RetryContextSupport.java
deleted file mode 100644
index 321c67ee5..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/RetryContextSupport.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.context;
-
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryPolicy;
-import org.springframework.core.AttributeAccessorSupport;
-
-public class RetryContextSupport extends AttributeAccessorSupport implements RetryContext {
-
- private boolean terminate = false;
-
- private int count;
-
- private Throwable lastException;
-
- private RetryContext parent;
-
- public RetryContextSupport(RetryContext parent) {
- super();
- this.parent = parent;
- }
-
- public RetryContext getParent() {
- return this.parent;
- }
-
- public boolean isExhaustedOnly() {
- return terminate;
- }
-
- public void setExhaustedOnly() {
- terminate = true;
- }
-
- public int getRetryCount() {
- return count;
- }
-
- public Throwable getLastThrowable() {
- return lastException;
- }
-
- /**
- * Set the exception for the public interface {@link RetryContext}, and
- * also increment the retry count if the throwable is non-null.
- *
- * All {@link RetryPolicy} implementations should use this method when they
- * register the throwable. It should only be called once per retry attempt
- * because it increments a counter.
- *
- * Use of this method is not enforced by the framework - it is a service
- * provider contract for authors of policies.
- *
- * @param throwable the exception that caused the current retry attempt to
- * fail.
- */
- public void registerThrowable(Throwable throwable) {
- this.lastException = throwable;
- if (throwable != null)
- count++;
- }
-
- @Override
- public String toString() {
- return String.format("[RetryContext: count=%d, lastException=%s, exhausted=%b]", count, lastException, terminate);
- }
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/package.html b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/package.html
deleted file mode 100644
index d27756320..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/context/package.html
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-Infrastructure implementations of retry context concerns.
-
-
-
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodArgumentsKeyGenerator.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodArgumentsKeyGenerator.java
deleted file mode 100644
index ddbae85c6..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodArgumentsKeyGenerator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.springframework.batch.retry.interceptor;
-
-/**
- * Interface that allows method parameters to be identified and tagged by a
- * unique key.
- *
- * @author Dave Syer
- *
- */
-public interface MethodArgumentsKeyGenerator {
-
- /**
- * Get a unique identifier for the item that can be used to cache it between
- * calls if necessary, and then identify it later.
- *
- * @param item the current item.
- * @return a unique identifier.
- */
- Object getKey(Object[] item);
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodInvocationRecoverer.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodInvocationRecoverer.java
deleted file mode 100644
index cbc16ca44..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/MethodInvocationRecoverer.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.interceptor;
-
-
-/**
- * Strategy interface for recovery action when processing of an item fails.
- *
- * @author Dave Syer
- */
-public interface MethodInvocationRecoverer {
-
- /**
- * Recover gracefully from an error. Clients can call this if processing of
- * the item throws an unexpected exception. Caller can use the return value
- * to decide whether to try more corrective action or perhaps throw an
- * exception.
- *
- * @param args
- * the arguments for the method invocation that failed.
- * @param cause
- * the cause of the failure that led to this recovery.
- * @return the value to be returned to the caller
- */
- T recover(Object[] args, Throwable cause);
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/NewMethodArgumentsIdentifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/NewMethodArgumentsIdentifier.java
deleted file mode 100644
index 86548dcfd..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/NewMethodArgumentsIdentifier.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.interceptor;
-
-/**
- * Strategy interface to distinguish new arguments from ones that have been
- * processed before, e.g. by examining a message flag.
- *
- * @author Dave Syer
- *
- */
-public interface NewMethodArgumentsIdentifier {
-
- /**
- * Inspect the arguments and determine if they have never been processed
- * before. The safest choice when the answer is indeterminate is 'false'.
- *
- * @param args the current method arguments.
- * @return true if the item is known to have never been processed before.
- */
- boolean isNew(Object[] args);
-
-}
diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptor.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptor.java
deleted file mode 100644
index b09caf6be..000000000
--- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/interceptor/RetryOperationsInterceptor.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright 2006-2007 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.batch.retry.interceptor;
-
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-import org.springframework.aop.ProxyMethodInvocation;
-import org.springframework.batch.retry.RetryCallback;
-import org.springframework.batch.retry.RetryContext;
-import org.springframework.batch.retry.RetryOperations;
-import org.springframework.batch.retry.support.RetryTemplate;
-import org.springframework.util.Assert;
-
-/**
- * A {@link MethodInterceptor} that can be used to automatically retry calls to
- * a method on a service if it fails. The injected {@link RetryOperations} is
- * used to control the number of retries. By default it will retry a fixed
- * number of times, according to the defaults in {@link RetryTemplate}.
- *
- * Hint about transaction boundaries. If you want to retry a failed transaction
- * you need to make sure that the transaction boundary is inside the retry,
- * otherwise the successful attempt will roll back with the whole transaction.
- * If the method being intercepted is also transactional, then use the ordering
- * hints in the advice declarations to ensure that this one is before the
- * transaction interceptor in the advice chain.
- *
- * @author Rob Harrop
- * @author Dave Syer
- */
-public class RetryOperationsInterceptor implements MethodInterceptor {
-
- private RetryOperations retryOperations = new RetryTemplate();
-
- public void setRetryOperations(RetryOperations retryTemplate) {
- Assert.notNull(retryTemplate, "'retryOperations' cannot be null.");
- this.retryOperations = retryTemplate;
- }
-
- public Object invoke(final MethodInvocation invocation) throws Throwable {
-
- return this.retryOperations.execute(new RetryCallback