diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java index 2004b1cc7..ddba9c48f 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SkipLimitStepFactoryBean.java @@ -78,6 +78,14 @@ public class SkipLimitStepFactoryBean extends SimpleStepFactoryBean { public void setItemKeyGenerator(ItemKeyGenerator itemKeyGenerator) { this.itemKeyGenerator = itemKeyGenerator; } + + /** + * Protected getter for the {@link ItemKeyGenerator}. + * @return the {@link ItemKeyGenerator} + */ + protected ItemKeyGenerator getItemKeyGenerator() { + return itemKeyGenerator; + } /** * Uses the {@link #skipLimit} value to configure item handler and and diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/StatefulRetryStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/StatefulRetryStepFactoryBean.java index 6900a3b42..ead936fd9 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/StatefulRetryStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/StatefulRetryStepFactoryBean.java @@ -44,15 +44,13 @@ import org.springframework.batch.retry.support.RetryTemplate; * handling policy. Only exhausted retries count against the exception handler, * instead of counting all exceptions.
* - * This class is not designed for extension. Do not subclass it. + * This class is not designed for extension. Do not subclass it. * * @author Dave Syer * */ public class StatefulRetryStepFactoryBean extends SkipLimitStepFactoryBean { - private ItemKeyGenerator itemKeyGenerator; - private ItemRecoverer itemRecoverer; private int retryLimit; @@ -96,20 +94,6 @@ public class StatefulRetryStepFactoryBean extends SkipLimitStepFactoryBean { this.retryListeners = retryListeners; } - /** - * Public setter for the {@link ItemKeyGenerator} which will be used to - * cache failed items between transactions. If it is not injected but the - * reader or writer implement {@link ItemKeyGenerator}, one of those will - * be used instead (preferring the reader to the writer if both would be - * appropriate). If neither can be used, then the default will be to just - * use the item itself as a cache key. - * - * @param itemKeyGenerator the {@link ItemKeyGenerator} to set - */ - public void setItemKeyGenerator(ItemKeyGenerator itemKeyGenerator) { - this.itemKeyGenerator = itemKeyGenerator; - } - /** * Public setter for the {@link ItemRecoverer}. If this is set the * {@link ItemRecoverer#recover(Object, Throwable)} will be called when @@ -153,7 +137,7 @@ public class StatefulRetryStepFactoryBean extends SkipLimitStepFactoryBean { } StatefulRetryItemHandler itemHandler = new StatefulRetryItemHandler(getItemReader(), getItemWriter(), - retryTemplate, itemKeyGenerator, itemRecoverer); + retryTemplate, getItemKeyGenerator(), itemRecoverer); step.setItemHandler(itemHandler);