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 11e0736ce..d6773a43e 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 @@ -25,7 +25,7 @@ import java.util.Map; import org.springframework.batch.core.Step; import org.springframework.batch.core.StepExecution; import org.springframework.batch.item.file.FlatFileParseException; -import org.springframework.batch.support.ExceptionClassifier; +import org.springframework.batch.support.Classifier; import org.springframework.batch.support.SubclassExceptionClassifier; /** @@ -70,7 +70,7 @@ public class LimitCheckingItemSkipPolicy implements ItemSkipPolicy { private final int skipLimit; - private ExceptionClassifier exceptionClassifier; + private Classifier exceptionClassifier; /** * Convenience constructor that assumes all exception types are skippable 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 7623d9ab5..0d87b923c 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 @@ -20,11 +20,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.repeat.RepeatContext; import org.springframework.batch.repeat.RepeatException; -import org.springframework.batch.support.ExceptionClassifier; +import org.springframework.batch.support.Classifier; import org.springframework.batch.support.ExceptionClassifierSupport; /** - * Implementation of {@link ExceptionHandler} based on an {@link ExceptionClassifier}. The classifier determines + * Implementation of {@link ExceptionHandler} based on an {@link Classifier}. The classifier determines * whether to log the exception or rethrow it. The keys in the classifier must be the same as the static contants in * this class. * @@ -34,41 +34,41 @@ import org.springframework.batch.support.ExceptionClassifierSupport; public class LogOrRethrowExceptionHandler implements ExceptionHandler { /** - * Key for {@link ExceptionClassifier} signalling that the throwable should be rethrown. If the throwable is not a + * Key for {@link Classifier} signalling that the throwable should be rethrown. If the throwable is not a * RuntimeException it is wrapped in a {@link RepeatException}. */ public static final String RETHROW = "rethrow"; /** - * Key for {@link ExceptionClassifier} signalling that the throwable should be logged at debug level. + * Key for {@link Classifier} signalling that the throwable should be logged at debug level. */ public static final String DEBUG = "debug"; /** - * Key for {@link ExceptionClassifier} signalling that the throwable should be logged at warn level. + * Key for {@link Classifier} signalling that the throwable should be logged at warn level. */ public static final String WARN = "warn"; /** - * Key for {@link ExceptionClassifier} signalling that the throwable should be logged at error level. + * Key for {@link Classifier} signalling that the throwable should be logged at error level. */ public static final String ERROR = "error"; protected final Log logger = LogFactory.getLog(LogOrRethrowExceptionHandler.class); - private ExceptionClassifier exceptionClassifier = new ExceptionClassifierSupport() { + private Classifier exceptionClassifier = new ExceptionClassifierSupport() { public String classify(Throwable throwable) { return RETHROW; } }; /** - * Setter for the {@link ExceptionClassifier} used by this handler. The default is to map all throwable instances to + * Setter for the {@link Classifier} used by this handler. The default is to map all throwable instances to * {@link #RETHROW}. * * @param exceptionClassifier the ExceptionClassifier to use */ - public void setExceptionClassifier(ExceptionClassifier exceptionClassifier) { + public void setExceptionClassifier(Classifier exceptionClassifier) { this.exceptionClassifier = exceptionClassifier; } 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 e7f8a3f8d..1baf09ee8 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 @@ -23,12 +23,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.repeat.RepeatContext; import org.springframework.batch.repeat.context.RepeatContextCounter; -import org.springframework.batch.support.ExceptionClassifier; +import org.springframework.batch.support.Classifier; import org.springframework.batch.support.ExceptionClassifierSupport; /** * Implementation of {@link ExceptionHandler} that rethrows when exceptions of a - * given type reach a threshold. Requires an {@link ExceptionClassifier} that + * given type reach a threshold. Requires an {@link Classifier} that * maps exception types to unique keys, and also a map from those keys to * threshold values (Integer type). * @@ -39,7 +39,7 @@ public class RethrowOnThresholdExceptionHandler implements ExceptionHandler { protected final Log logger = LogFactory.getLog(RethrowOnThresholdExceptionHandler.class); - private ExceptionClassifier exceptionClassifier = new ExceptionClassifierSupport(); + private Classifier exceptionClassifier = new ExceptionClassifierSupport(); private Map thresholds = new HashMap(); @@ -68,7 +68,7 @@ public class RethrowOnThresholdExceptionHandler implements ExceptionHandler { /** * A map from classifier keys to a threshold value of type Integer. The keys - * are usually String literals, depending on the {@link ExceptionClassifier} + * are usually String literals, depending on the {@link Classifier} * implementation used. * * @param thresholds the threshold value map. @@ -78,14 +78,14 @@ public class RethrowOnThresholdExceptionHandler implements ExceptionHandler { } /** - * Setter for the {@link ExceptionClassifier} used by this handler. The + * Setter for the {@link Classifier} used by this handler. The * default is to map all throwable instances to * {@link ExceptionClassifierSupport#DEFAULT}, which are then mapped to a * threshold of 0 by the {@link #setThresholds(Map)} map. * * @param exceptionClassifier ExceptionClassifier to use */ - public void setExceptionClassifier(ExceptionClassifier exceptionClassifier) { + public void setExceptionClassifier(Classifier exceptionClassifier) { this.exceptionClassifier = exceptionClassifier; } diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicy.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicy.java index 968292a6d..754ac79cb 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicy.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/retry/policy/ExceptionClassifierRetryPolicy.java @@ -24,7 +24,7 @@ import org.springframework.batch.retry.RetryContext; import org.springframework.batch.retry.RetryPolicy; import org.springframework.batch.retry.TerminatedRetryException; import org.springframework.batch.retry.context.RetryContextSupport; -import org.springframework.batch.support.ExceptionClassifier; +import org.springframework.batch.support.Classifier; import org.springframework.batch.support.ExceptionClassifierSupport; import org.springframework.util.Assert; @@ -37,7 +37,7 @@ import org.springframework.util.Assert; */ public class ExceptionClassifierRetryPolicy extends AbstractStatelessRetryPolicy { - private ExceptionClassifier exceptionClassifier = new ExceptionClassifierSupport(); + private Classifier exceptionClassifier = new ExceptionClassifierSupport(); private Map policyMap = new HashMap(); @@ -51,7 +51,7 @@ public class ExceptionClassifierRetryPolicy extends AbstractStatelessRetryPolicy * running application. * * @param policyMap a map of String to {@link RetryPolicy} that will be - * applied to the result of the {@link ExceptionClassifier} to locate a + * applied to the result of the {@link Classifier} to locate a * policy. */ public void setPolicyMap(Map policyMap) { @@ -64,7 +64,7 @@ public class ExceptionClassifierRetryPolicy extends AbstractStatelessRetryPolicy * * @param exceptionClassifier ExceptionClassifier to use */ - public void setExceptionClassifier(ExceptionClassifier exceptionClassifier) { + public void setExceptionClassifier(Classifier exceptionClassifier) { this.exceptionClassifier = exceptionClassifier; } @@ -113,7 +113,7 @@ public class ExceptionClassifierRetryPolicy extends AbstractStatelessRetryPolicy private class ExceptionClassifierRetryContext extends RetryContextSupport implements RetryPolicy { - private ExceptionClassifier exceptionClassifier; + private Classifier exceptionClassifier; // Dynamic: depends on the latest exception: RetryPolicy policy; @@ -126,7 +126,7 @@ public class ExceptionClassifierRetryPolicy extends AbstractStatelessRetryPolicy Map contexts = new HashMap(); - public ExceptionClassifierRetryContext(RetryContext parent, ExceptionClassifier exceptionClassifier) { + public ExceptionClassifierRetryContext(RetryContext parent, Classifier exceptionClassifier) { super(parent); this.exceptionClassifier = exceptionClassifier; Object key = exceptionClassifier.getDefault(); diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/BinaryExceptionClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/BinaryExceptionClassifier.java index db136bcd1..9bd90aa4a 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/BinaryExceptionClassifier.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/BinaryExceptionClassifier.java @@ -20,7 +20,7 @@ import java.util.HashMap; import java.util.Map; /** - * A {@link ExceptionClassifier} that has only two classes of exception. + * A {@link Classifier} that has only two classes of exception. * Provides convenient methods for setting up and querying the classification * with boolean return type. * diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifier.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/Classifier.java similarity index 96% rename from spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifier.java rename to spring-batch-infrastructure/src/main/java/org/springframework/batch/support/Classifier.java index 4de99695b..9ca160d0d 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifier.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/Classifier.java @@ -22,7 +22,7 @@ package org.springframework.batch.support; * @author Dave Syer * */ -public interface ExceptionClassifier { +public interface Classifier { /** * Get a default value, normally the same as would be returned by diff --git a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifierSupport.java b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifierSupport.java index e0b5f6864..b1c20e945 100644 --- a/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifierSupport.java +++ b/spring-batch-infrastructure/src/main/java/org/springframework/batch/support/ExceptionClassifierSupport.java @@ -17,13 +17,13 @@ package org.springframework.batch.support; /** - * Base class for {@link ExceptionClassifier} implementations. Provides default + * Base class for {@link Classifier} implementations. Provides default * behaviour and some convenience members, like constants. * * @author Dave Syer * */ -public class ExceptionClassifierSupport implements ExceptionClassifier { +public class ExceptionClassifierSupport implements Classifier { /** * Default classification key. @@ -33,7 +33,7 @@ public class ExceptionClassifierSupport implements ExceptionClassifier