listenerElements = DomUtils.getChildElementsByTagName(element, "listener");
if (listenerElements != null) {
for (Element listenerElement : listenerElements) {
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
index af1a0a508..3ed303631 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/resource/StepExecutionSimpleCompletionPolicy.java
@@ -27,12 +27,21 @@ import org.springframework.batch.repeat.policy.SimpleCompletionPolicy;
import org.springframework.util.Assert;
/**
+ *
* A {@link CompletionPolicy} that picks up a commit interval from
* {@link JobParameters} by listening to the start of a step. Use anywhere that
* a {@link CompletionPolicy} can be used (usually at the chunk level in a
* step), and inject as a {@link StepExecutionListener} into the surrounding
* step. N.B. only after the step has started will the completion policy be
* usable.
+ *
+ *
+ *
+ * It is easier and probably preferable to simply declare the chunk with a
+ * commit-interval that is a late-binding expression (e.g.
+ * #{jobParameters['commit.interval']}). That feature is available
+ * from of Spring Batch 2.1.7.
+ *
*
* @author Dave Syer
*
diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd
index 5593eba61..ed8f43660 100644
--- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd
+++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.1.xsd
@@ -823,7 +823,8 @@ ref" is not required, and only needs to be specified explicitly
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 a2cfbd363..13f99084c 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
@@ -65,6 +65,14 @@ public class ChunkElementParserTests {
assertTrue("Wrong processor type", chunkProcessor instanceof SimpleChunkProcessor);
}
+ @Test
+ public void testCommitIntervalLateBinding() throws Exception {
+ ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(
+ "org/springframework/batch/core/configuration/xml/ChunkElementCommitIntervalParserTests-context.xml");
+ Step step = (Step) context.getBean("s1", Step.class);
+ assertNotNull("Step not parsed", step);
+ }
+
@Test
public void testRetryPolicyAttribute() throws Exception {
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext(