Skip to content

Commit 54258d6

Browse files
author
robokaso
committed
RESOLVED - BATCH-930: rename ItemSkipPolicy
ItemSkipPolicy => SkipPolicy
1 parent 117becf commit 54258d6

File tree

9 files changed

+26
-26
lines changed

9 files changed

+26
-26
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/AbstractFaultTolerantChunkOrientedTasklet.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import org.springframework.batch.core.SkipListener;
1111
import org.springframework.batch.core.StepContribution;
12-
import org.springframework.batch.core.step.skip.ItemSkipPolicy;
12+
import org.springframework.batch.core.step.skip.SkipPolicy;
1313
import org.springframework.batch.core.step.skip.SkipListenerFailedException;
1414
import org.springframework.batch.item.ItemProcessor;
1515
import org.springframework.batch.item.ItemReader;
@@ -48,18 +48,18 @@ public abstract class AbstractFaultTolerantChunkOrientedTasklet<I, O> extends Ab
4848

4949
final private RepeatOperations repeatOperations;
5050

51-
final private ItemSkipPolicy writeSkipPolicy;
51+
final private SkipPolicy writeSkipPolicy;
5252

53-
final private ItemSkipPolicy processSkipPolicy;
53+
final private SkipPolicy processSkipPolicy;
5454

55-
final private ItemSkipPolicy readSkipPolicy;
55+
final private SkipPolicy readSkipPolicy;
5656

5757
final private Classifier<Throwable, Boolean> rollbackClassifier;
5858

5959
public AbstractFaultTolerantChunkOrientedTasklet(ItemReader<? extends I> itemReader,
6060
ItemProcessor<? super I, ? extends O> itemProcessor, ItemWriter<? super O> itemWriter,
61-
RetryOperations retryOperations, ItemSkipPolicy readSkipPolicy, ItemSkipPolicy processSkipPolicy,
62-
ItemSkipPolicy writeSkipPolicy, Classifier<Throwable, Boolean> rollbackClassifier,
61+
RetryOperations retryOperations, SkipPolicy readSkipPolicy, SkipPolicy processSkipPolicy,
62+
SkipPolicy writeSkipPolicy, Classifier<Throwable, Boolean> rollbackClassifier,
6363
RepeatOperations repeatTemplate) {
6464

6565
super(itemReader, itemProcessor, itemWriter);
@@ -71,7 +71,7 @@ public AbstractFaultTolerantChunkOrientedTasklet(ItemReader<? extends I> itemRea
7171
this.repeatOperations = repeatTemplate;
7272
}
7373

74-
protected ItemSkipPolicy getReadSkipPolicy() {
74+
protected SkipPolicy getReadSkipPolicy() {
7575
return readSkipPolicy;
7676
}
7777

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantChunkOrientedTasklet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
import org.springframework.batch.core.ExitStatus;
2323
import org.springframework.batch.core.StepContribution;
24-
import org.springframework.batch.core.step.skip.ItemSkipPolicy;
24+
import org.springframework.batch.core.step.skip.SkipPolicy;
2525
import org.springframework.batch.core.step.skip.NonSkippableReadException;
2626
import org.springframework.batch.item.ItemProcessor;
2727
import org.springframework.batch.item.ItemReader;
@@ -59,8 +59,8 @@ public class FaultTolerantChunkOrientedTasklet<I, O> extends AbstractFaultTolera
5959
public FaultTolerantChunkOrientedTasklet(ItemReader<? extends I> itemReader,
6060
ItemProcessor<? super I, ? extends O> itemProcessor, ItemWriter<? super O> itemWriter,
6161
RepeatOperations chunkOperations, RetryOperations retryTemplate,
62-
Classifier<Throwable, Boolean> rollbackClassifier, ItemSkipPolicy readSkipPolicy,
63-
ItemSkipPolicy writeSkipPolicy, ItemSkipPolicy processSkipPolicy) {
62+
Classifier<Throwable, Boolean> rollbackClassifier, SkipPolicy readSkipPolicy,
63+
SkipPolicy writeSkipPolicy, SkipPolicy processSkipPolicy) {
6464

6565
super(itemReader, itemProcessor, itemWriter, retryTemplate, readSkipPolicy, processSkipPolicy, writeSkipPolicy,
6666
rollbackClassifier, chunkOperations);

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/FaultTolerantStepFactoryBean.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.util.HashSet;
77
import java.util.List;
88

9-
import org.springframework.batch.core.step.skip.ItemSkipPolicy;
9+
import org.springframework.batch.core.step.skip.SkipPolicy;
1010
import org.springframework.batch.core.step.skip.LimitCheckingItemSkipPolicy;
1111
import org.springframework.batch.core.step.skip.NonSkippableReadException;
1212
import org.springframework.batch.core.step.skip.SkipLimitExceededException;
@@ -257,10 +257,10 @@ public Boolean classify(Throwable classifiable) {
257257

258258
List<Class<? extends Throwable>> exceptions = new ArrayList<Class<? extends Throwable>>(
259259
skippableExceptionClasses);
260-
ItemSkipPolicy readSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, skippableExceptionClasses,
260+
SkipPolicy readSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, skippableExceptionClasses,
261261
new ArrayList<Class<? extends Throwable>>(fatalExceptionClasses));
262262
exceptions.addAll(new ArrayList<Class<? extends Throwable>>(retryableExceptionClasses));
263-
ItemSkipPolicy writeSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, exceptions,
263+
SkipPolicy writeSkipPolicy = new LimitCheckingItemSkipPolicy(skipLimit, exceptions,
264264
new ArrayList<Class<? extends Throwable>>(fatalExceptionClasses));
265265

266266
if (isReaderTransactionalQueue) {

spring-batch-core/src/main/java/org/springframework/batch/core/step/item/NonbufferingFaultTolerantChunkOrientedTasklet.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import org.springframework.batch.core.ExitStatus;
1010
import org.springframework.batch.core.StepContribution;
11-
import org.springframework.batch.core.step.skip.ItemSkipPolicy;
11+
import org.springframework.batch.core.step.skip.SkipPolicy;
1212
import org.springframework.batch.core.step.skip.SkipListenerFailedException;
1313
import org.springframework.batch.item.ItemProcessor;
1414
import org.springframework.batch.item.ItemReader;
@@ -41,8 +41,8 @@ public class NonbufferingFaultTolerantChunkOrientedTasklet<I, O> extends
4141
public NonbufferingFaultTolerantChunkOrientedTasklet(ItemReader<? extends I> itemReader,
4242
ItemProcessor<? super I, ? extends O> itemProcessor, ItemWriter<? super O> itemWriter,
4343
RepeatOperations chunkOperations, RetryOperations retryTemplate,
44-
Classifier<Throwable, Boolean> rollbackClassifier, ItemSkipPolicy readSkipPolicy,
45-
ItemSkipPolicy writeSkipPolicy, ItemSkipPolicy processSkipPolicy) {
44+
Classifier<Throwable, Boolean> rollbackClassifier, SkipPolicy readSkipPolicy,
45+
SkipPolicy writeSkipPolicy, SkipPolicy processSkipPolicy) {
4646

4747
super(itemReader, itemProcessor, itemWriter, retryTemplate, readSkipPolicy, processSkipPolicy, writeSkipPolicy,
4848
rollbackClassifier, chunkOperations);

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/AlwaysSkipItemSkipPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717

1818

1919
/**
20-
* Implementation of the {@link ItemSkipPolicy} interface that
20+
* Implementation of the {@link SkipPolicy} interface that
2121
* will always return that an item should be skipped.
2222
*
2323
* @author Ben Hale
2424
* @author Lucas Ward
2525
*/
26-
public class AlwaysSkipItemSkipPolicy implements ItemSkipPolicy {
26+
public class AlwaysSkipItemSkipPolicy implements SkipPolicy {
2727

2828
public boolean shouldSkip(Throwable t, int skipCount) {
2929
return true;

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/LimitCheckingItemSkipPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
/**
2828
* <p>
29-
* {@link ItemSkipPolicy} that determines whether or not reading should continue
29+
* {@link SkipPolicy} that determines whether or not reading should continue
3030
* based upon how many items have been skipped. This is extremely useful
3131
* behavior, as it allows you to skip records, but will throw a
3232
* {@link SkipLimitExceededException} if a set limit has been exceeded. For
@@ -52,7 +52,7 @@
5252
* @author Lucas Ward
5353
* @author Robert Kasanicky
5454
*/
55-
public class LimitCheckingItemSkipPolicy implements ItemSkipPolicy {
55+
public class LimitCheckingItemSkipPolicy implements SkipPolicy {
5656

5757
private final int skipLimit;
5858

spring-batch-core/src/main/java/org/springframework/batch/core/step/skip/NeverSkipItemSkipPolicy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717

1818

1919
/**
20-
* {@link ItemSkipPolicy} implementation that always returns false,
20+
* {@link SkipPolicy} implementation that always returns false,
2121
* indicating that an item should not be skipped.
2222
*
2323
* @author Lucas Ward
2424
*/
25-
public class NeverSkipItemSkipPolicy implements ItemSkipPolicy{
25+
public class NeverSkipItemSkipPolicy implements SkipPolicy{
2626

2727
public boolean shouldSkip(Throwable t, int skipCount) {
2828
return false;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @author Lucas Ward
2222
* @author Dave Syer
2323
*/
24-
public interface ItemSkipPolicy {
24+
public interface SkipPolicy {
2525

2626
/**
2727
* Returns true or false, indicating whether or not processing should

spring-batch-core/src/test/java/org/springframework/batch/core/step/item/FaultTolerantChunkOrientedTaskletTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import org.springframework.batch.core.StepContribution;
3434
import org.springframework.batch.core.StepExecution;
3535
import org.springframework.batch.core.scope.ChunkContext;
36-
import org.springframework.batch.core.step.skip.ItemSkipPolicy;
36+
import org.springframework.batch.core.step.skip.SkipPolicy;
3737
import org.springframework.batch.core.step.skip.SkipLimitExceededException;
3838
import org.springframework.batch.item.ItemProcessor;
3939
import org.springframework.batch.item.ItemReader;
@@ -95,7 +95,7 @@ public Boolean classify(Throwable classifiable) {
9595
}
9696
};
9797

98-
private ItemSkipPolicy readSkipPolicy = new ItemSkipPolicy() {
98+
private SkipPolicy readSkipPolicy = new SkipPolicy() {
9999
public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededException {
100100
if (skipCount < skipLimit) {
101101
return true;
@@ -104,7 +104,7 @@ public boolean shouldSkip(Throwable t, int skipCount) throws SkipLimitExceededEx
104104
}
105105
};
106106

107-
private ItemSkipPolicy writeSkipPolicy = readSkipPolicy;
107+
private SkipPolicy writeSkipPolicy = readSkipPolicy;
108108

109109
@Before
110110
public void setUp() {

0 commit comments

Comments
 (0)