diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java index 46ef988d3..37ce1f91a 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/AbstractStepParser.java @@ -18,6 +18,7 @@ package org.springframework.batch.core.configuration.xml; import java.util.Arrays; import java.util.List; +import org.springframework.beans.MutablePropertyValues; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.parsing.CompositeComponentDefinition; @@ -48,45 +49,40 @@ public abstract class AbstractStepParser { private static final String PARENT_ATTR = "parent"; - private static final String TASKLET_ATTR = "tasklet"; + private static final String TASKLET_REF_ATTR = "ref"; private static final String TASKLET_ELE = "tasklet"; + private static final String CHUNK_TASKLET_ELE = "chunk-tasklet"; + private static final String LISTENERS_ELE = "listeners"; private static final String MERGE_ATTR = "merge"; private static final String TX_ATTRIBUTES_ELE = "transaction-attributes"; - private TaskletElementParser taskletElementParser = new TaskletElementParser(); + private static final String JOB_REPO_ATTR = "job-repository"; - private StepListenerParser stepListenerParser = new StepListenerParser(); + private static final ChunkTaskletParser chunkTaskletParser = new ChunkTaskletParser(); + + private static final StepListenerParser stepListenerParser = new StepListenerParser(); /** - * @param stepElement + * @param stepElement The <step/> element * @param parserContext - * @return a BeanDefinition if possible + * @param jobRepositoryRef The name of the bean defining the JobRepository. + * Use 'null' if the job-repository is specified on the + * <tasklet/> element; this method will look it up. */ - protected AbstractBeanDefinition parseTasklet(Element stepElement, ParserContext parserContext, - String jobRepositoryRef) { + protected AbstractBeanDefinition parseStep(Element stepElement, ParserContext parserContext, String jobRepositoryRef) { + + AbstractBeanDefinition bd = new GenericBeanDefinition(); - String taskletRef = stepElement.getAttribute(TASKLET_ATTR); @SuppressWarnings("unchecked") List taskletElements = (List) DomUtils.getChildElementsByTagName(stepElement, TASKLET_ELE); - boolean stepUnderspecified = CoreNamespaceUtils.isUnderspecified(stepElement); - AbstractBeanDefinition bd = null; - if (StringUtils.hasText(taskletRef)) { - if (taskletElements.size() > 0) { - parserContext.getReaderContext().error( - "The <" + TASKLET_ELE + "/> element can't be combined with the '" + TASKLET_ATTR + "=\"" - + taskletRef + "\"' attribute specification for <" + stepElement.getNodeName() + "/>", - stepElement); - } - bd = parseTaskletRef(stepElement, taskletRef, parserContext, jobRepositoryRef); - } - else if (taskletElements.size() == 1) { - Element taskElement = taskletElements.get(0); - bd = taskletElementParser.parse(taskElement, parserContext, stepUnderspecified); + if (taskletElements.size() == 1) { + boolean stepUnderspecified = CoreNamespaceUtils.isUnderspecified(stepElement); + parseTasklet(taskletElements.get(0), bd, parserContext, jobRepositoryRef, stepUnderspecified); } else if (taskletElements.size() > 1) { parserContext.getReaderContext().error( @@ -94,69 +90,102 @@ public abstract class AbstractStepParser { + stepElement.getNodeName() + "/>.", stepElement); } - if (bd == null) { - if (stepUnderspecified) { - bd = new GenericBeanDefinition(); - } - else { - parserContext.getReaderContext().error( - "Step [" + stepElement.getAttribute(ID_ATTR) + "] has neither a <" + TASKLET_ELE - + "/> element nor a '" + TASKLET_ATTR + "' attribute.", stepElement); - } + String parentRef = stepElement.getAttribute(PARENT_ATTR); + if (StringUtils.hasText(parentRef)) { + bd.setParentName(parentRef); } - setUpBeanDefinition(stepElement, bd, parserContext, jobRepositoryRef); - return bd; - - } - - /** - * @param stepElement - * @param taskletRef - * @param parserContext - */ - private AbstractBeanDefinition parseTaskletRef(Element stepElement, String taskletRef, ParserContext parserContext, - String jobRepositoryRef) { - - GenericBeanDefinition bd = new GenericBeanDefinition(); - bd.setBeanClass(StepParserStepFactoryBean.class); - - if (StringUtils.hasText(taskletRef)) { - RuntimeBeanReference taskletBeanRef = new RuntimeBeanReference(taskletRef); - bd.getPropertyValues().addPropertyValue("tasklet", taskletBeanRef); - } - - return bd; - - } - - protected void setUpBeanDefinition(Element stepElement, AbstractBeanDefinition bd, ParserContext parserContext, - String jobRepositoryRef) { - checkStepAttributes(stepElement, bd); - bd.setAbstract(Boolean.valueOf(stepElement.getAttribute("abstract"))); - RuntimeBeanReference jobRepositoryBeanRef = new RuntimeBeanReference(jobRepositoryRef); - bd.getPropertyValues().addPropertyValue("jobRepository", jobRepositoryBeanRef); + return bd; - String transactionManagerRef = stepElement.getAttribute("transaction-manager"); + } + + private void parseTasklet(Element taskletElement, AbstractBeanDefinition bd, ParserContext parserContext, + String jobRepositoryRef, boolean stepUnderspecified) { + + bd.setBeanClass(StepParserStepFactoryBean.class); + + String taskletRef = taskletElement.getAttribute(TASKLET_REF_ATTR); + @SuppressWarnings("unchecked") + List chunkTaskletElements = (List) DomUtils.getChildElementsByTagName(taskletElement, + CHUNK_TASKLET_ELE); + if (StringUtils.hasText(taskletRef)) { + if (chunkTaskletElements.size() > 0) { + parserContext.getReaderContext().error( + "The <" + CHUNK_TASKLET_ELE + "/> element can't be combined with the '" + TASKLET_REF_ATTR + + "=\"" + taskletRef + "\"' attribute specification for <" + + taskletElement.getNodeName() + "/>", taskletElement); + } + parseTaskletRef(taskletRef, bd.getPropertyValues()); + } + else if (chunkTaskletElements.size() == 1) { + chunkTaskletParser.parse(chunkTaskletElements.get(0), bd, parserContext, stepUnderspecified); + } + else if (chunkTaskletElements.size() > 1) { + parserContext.getReaderContext().error( + "The '<" + CHUNK_TASKLET_ELE + "/>' element may not appear more than once in a single <" + + taskletElement.getNodeName() + "/>.", taskletElement); + } + else if (!stepUnderspecified) { + parserContext.getReaderContext().error( + "Step [" + taskletElement.getAttribute(ID_ATTR) + "] has neither a <" + CHUNK_TASKLET_ELE + + "/> element nor a '" + TASKLET_REF_ATTR + "' attribute.", taskletElement); + } + + setUpBeanDefinitionForTaskletStep(taskletElement, bd, parserContext, jobRepositoryRef); + + } + + private void parseTaskletRef(String taskletRef, MutablePropertyValues propertyValues) { + if (StringUtils.hasText(taskletRef)) { + RuntimeBeanReference taskletBeanRef = new RuntimeBeanReference(taskletRef); + propertyValues.addPropertyValue("tasklet", taskletBeanRef); + } + } + + private void setUpBeanDefinitionForTaskletStep(Element taskletElement, AbstractBeanDefinition bd, + ParserContext parserContext, String jobRepositoryRef) { + + MutablePropertyValues propertyValues = bd.getPropertyValues(); + + checkStepAttributes(taskletElement, propertyValues); + + propertyValues.addPropertyValue("jobRepository", resolveJobRepositoryRef(taskletElement, parserContext, + jobRepositoryRef)); + + String transactionManagerRef = taskletElement.getAttribute("transaction-manager"); RuntimeBeanReference transactionManagerBeanRef = new RuntimeBeanReference(transactionManagerRef); - bd.getPropertyValues().addPropertyValue("transactionManager", transactionManagerBeanRef); + propertyValues.addPropertyValue("transactionManager", transactionManagerBeanRef); - handleTransactionAttributesElement(stepElement, bd, parserContext); + handleTransactionAttributesElement(taskletElement, propertyValues, parserContext); - handleListenersElement(stepElement, bd, parserContext); + handleListenersElement(taskletElement, propertyValues, parserContext); - handleExceptionElement(stepElement, parserContext, bd, "no-rollback-exception-classes", + handleExceptionElement(taskletElement, parserContext, propertyValues, "no-rollback-exception-classes", "noRollbackExceptionClasses"); bd.setRole(BeanDefinition.ROLE_SUPPORT); - bd.setSource(parserContext.extractSource(stepElement)); + bd.setSource(parserContext.extractSource(taskletElement)); } - private void handleTransactionAttributesElement(Element stepElement, AbstractBeanDefinition bd, + private RuntimeBeanReference resolveJobRepositoryRef(Element taskletElement, ParserContext parserContext, + String jobRepositoryRef) { + if (!StringUtils.hasText(jobRepositoryRef)) { + jobRepositoryRef = taskletElement.getAttribute(JOB_REPO_ATTR); + if (!StringUtils.hasText(jobRepositoryRef)) { + parserContext.getReaderContext().error( + "The '" + JOB_REPO_ATTR + "' attribute may exist on an <" + taskletElement.getNodeName() + + "/> element.", taskletElement); + } + } + RuntimeBeanReference jobRepositoryBeanRef = new RuntimeBeanReference(jobRepositoryRef); + return jobRepositoryBeanRef; + } + + private void handleTransactionAttributesElement(Element stepElement, MutablePropertyValues propertyValues, ParserContext parserContext) { @SuppressWarnings("unchecked") List txAttrElements = DomUtils.getChildElementsByTagName(stepElement, TX_ATTRIBUTES_ELE); @@ -164,15 +193,15 @@ public abstract class AbstractStepParser { Element txAttrElement = txAttrElements.get(0); String propagation = txAttrElement.getAttribute("propagation"); if (StringUtils.hasText(propagation)) { - bd.getPropertyValues().addPropertyValue("propagation", propagation); + propertyValues.addPropertyValue("propagation", propagation); } String isolation = txAttrElement.getAttribute("isolation"); if (StringUtils.hasText(isolation)) { - bd.getPropertyValues().addPropertyValue("isolation", isolation); + propertyValues.addPropertyValue("isolation", isolation); } String timeout = txAttrElement.getAttribute("timeout"); if (StringUtils.hasText(timeout)) { - bd.getPropertyValues().addPropertyValue("transactionTimeout", timeout); + propertyValues.addPropertyValue("transactionTimeout", timeout); } } else if (txAttrElements.size() > 1) { @@ -183,8 +212,8 @@ public abstract class AbstractStepParser { } @SuppressWarnings("unchecked") - public static void handleExceptionElement(Element element, ParserContext parserContext, BeanDefinition bd, - String subElementName, String propertyName) { + public static void handleExceptionElement(Element element, ParserContext parserContext, + MutablePropertyValues propertyValues, String subElementName, String propertyName) { List children = DomUtils.getChildElementsByTagName(element, subElementName); if (children.size() == 1) { Element child = children.get(0); @@ -195,7 +224,7 @@ public abstract class AbstractStepParser { ManagedList managedList = new ManagedList(); managedList.setMergeEnabled(Boolean.valueOf(child.getAttribute(MERGE_ATTR))); managedList.addAll(Arrays.asList(exceptionArray)); - bd.getPropertyValues().addPropertyValue(propertyName, managedList); + propertyValues.addPropertyValue(propertyName, managedList); } } } @@ -207,23 +236,20 @@ public abstract class AbstractStepParser { } - private void checkStepAttributes(Element stepElement, AbstractBeanDefinition bd) { + private void checkStepAttributes(Element stepElement, MutablePropertyValues propertyValues) { String startLimit = stepElement.getAttribute("start-limit"); if (StringUtils.hasText(startLimit)) { - bd.getPropertyValues().addPropertyValue("startLimit", startLimit); + propertyValues.addPropertyValue("startLimit", startLimit); } String allowStartIfComplete = stepElement.getAttribute("allow-start-if-complete"); if (StringUtils.hasText(allowStartIfComplete)) { - bd.getPropertyValues().addPropertyValue("allowStartIfComplete", allowStartIfComplete); - } - String parentRef = stepElement.getAttribute(PARENT_ATTR); - if (StringUtils.hasText(parentRef)) { - bd.setParentName(parentRef); + propertyValues.addPropertyValue("allowStartIfComplete", allowStartIfComplete); } } @SuppressWarnings("unchecked") - private void handleListenersElement(Element stepElement, BeanDefinition bd, ParserContext parserContext) { + private void handleListenersElement(Element stepElement, MutablePropertyValues propertyValues, + ParserContext parserContext) { List listenersElements = DomUtils.getChildElementsByTagName(stepElement, LISTENERS_ELE); if (listenersElements.size() == 1) { Element listenersElement = listenersElements.get(0); @@ -238,7 +264,7 @@ public abstract class AbstractStepParser { listenerBeans.add(stepListenerParser.parse(listenerElement, parserContext)); } } - bd.getPropertyValues().addPropertyValue("listeners", listenerBeans); + propertyValues.addPropertyValue("listeners", listenerBeans); parserContext.popAndRegisterContainingComponent(); } else if (listenersElements.size() > 1) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TaskletElementParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParser.java similarity index 84% rename from spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TaskletElementParser.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParser.java index 8ae6d3f32..cfc68789b 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/TaskletElementParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParser.java @@ -20,12 +20,10 @@ import static org.springframework.batch.core.configuration.xml.AbstractStepParse import java.util.List; import org.springframework.beans.MutablePropertyValues; -import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanReference; import org.springframework.beans.factory.config.RuntimeBeanReference; import org.springframework.beans.factory.parsing.CompositeComponentDefinition; import org.springframework.beans.factory.support.AbstractBeanDefinition; -import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.beans.factory.support.ManagedList; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.beans.factory.xml.ParserContext; @@ -35,13 +33,12 @@ import org.w3c.dom.Element; import org.w3c.dom.NamedNodeMap; /** - * Internal parser for the <tasklet/> element either inside a job or as a - * standalone tasklet definition. + * Internal parser for the <chunk-tasklet/> element either inside a step. * * @author Thomas Risberg * @since 2.0 */ -public class TaskletElementParser { +public class ChunkTaskletParser { private static final String ID_ATTR = "id"; @@ -59,14 +56,11 @@ public class TaskletElementParser { * @param element * @param parserContext */ - protected AbstractBeanDefinition parse(Element element, ParserContext parserContext, boolean underspecified) { - - GenericBeanDefinition bd = new GenericBeanDefinition(); - bd.setBeanClass(StepParserStepFactoryBean.class); + protected void parse(Element element, AbstractBeanDefinition bd, ParserContext parserContext, boolean underspecified) { MutablePropertyValues propertyValues = bd.getPropertyValues(); - propertyValues.addPropertyValue("hasTaskletElement", Boolean.TRUE); + propertyValues.addPropertyValue("hasChunkTaskletElement", Boolean.TRUE); String readerBeanId = element.getAttribute("reader"); if (StringUtils.hasText(readerBeanId)) { @@ -106,7 +100,7 @@ public class TaskletElementParser { if (!underspecified && propertyValues.contains("commitInterval") == propertyValues.contains("chunkCompletionPolicy")) { parserContext.getReaderContext().error( - "The '" + element.getNodeName() + "' element must contain either '" + COMMIT_INTERVAL_ATTR + "' " + "The <" + element.getNodeName() + "/> element must contain either '" + COMMIT_INTERVAL_ATTR + "' " + "or '" + CHUNK_COMPLETION_POLICY_ATTR + "', but not both.", element); } @@ -130,21 +124,23 @@ public class TaskletElementParser { propertyValues.addPropertyValue("isReaderTransactionalQueue", isReaderTransactionalQueue); } - handleExceptionElement(element, parserContext, bd, "skippable-exception-classes", "skippableExceptionClasses"); + handleExceptionElement(element, parserContext, propertyValues, "skippable-exception-classes", + "skippableExceptionClasses"); - handleExceptionElement(element, parserContext, bd, "retryable-exception-classes", "retryableExceptionClasses"); + handleExceptionElement(element, parserContext, propertyValues, "retryable-exception-classes", + "retryableExceptionClasses"); - handleExceptionElement(element, parserContext, bd, "fatal-exception-classes", "fatalExceptionClasses"); + handleExceptionElement(element, parserContext, propertyValues, "fatal-exception-classes", + "fatalExceptionClasses"); - handleRetryListenersElement(element, bd, parserContext); + handleRetryListenersElement(element, propertyValues, parserContext); - handleStreamsElement(element, bd, parserContext); - - return bd; + handleStreamsElement(element, propertyValues, parserContext); } - private void handleRetryListenersElement(Element element, BeanDefinition bd, ParserContext parserContext) { + private void handleRetryListenersElement(Element element, MutablePropertyValues propertyValues, + ParserContext parserContext) { Element listenersElement = DomUtils.getChildElementByTagName(element, "retry-listeners"); if (listenersElement != null) { CompositeComponentDefinition compositeDef = new CompositeComponentDefinition(listenersElement.getTagName(), @@ -153,7 +149,7 @@ public class TaskletElementParser { ManagedList retryListenerBeans = new ManagedList(); retryListenerBeans.setMergeEnabled(Boolean.valueOf(listenersElement.getAttribute(MERGE_ATTR))); handleRetryListenerElements(parserContext, listenersElement, retryListenerBeans); - bd.getPropertyValues().addPropertyValue("retryListeners", retryListenerBeans); + propertyValues.addPropertyValue("retryListeners", retryListenerBeans); parserContext.popAndRegisterContainingComponent(); } } @@ -207,7 +203,7 @@ public class TaskletElementParser { } @SuppressWarnings("unchecked") - private void handleStreamsElement(Element element, BeanDefinition bd, ParserContext parserContext) { + private void handleStreamsElement(Element element, MutablePropertyValues propertyValues, ParserContext parserContext) { Element streamsElement = DomUtils.getChildElementByTagName(element, "streams"); if (streamsElement != null) { ManagedList streamBeans = new ManagedList(); @@ -226,7 +222,7 @@ public class TaskletElementParser { } } } - bd.getPropertyValues().addPropertyValue("streams", streamBeans); + propertyValues.addPropertyValue("streams", streamBeans); } } diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java index b3cf6f26f..732e60252 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/InlineStepParser.java @@ -56,7 +56,7 @@ public class InlineStepParser extends AbstractStepParser { BeanDefinitionBuilder stateBuilder = BeanDefinitionBuilder.genericBeanDefinition(StepState.class); String stepId = element.getAttribute(ID_ATTR); - AbstractBeanDefinition bd = parseTasklet(element, parserContext, jobRepositoryRef); + AbstractBeanDefinition bd = parseStep(element, parserContext, jobRepositoryRef); parserContext.registerBeanComponent(new BeanComponentDefinition(bd, stepId)); stateBuilder.addConstructorArgReference(stepId); diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java index 754a9ebdb..aabe143cd 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/JobParser.java @@ -37,7 +37,7 @@ import org.w3c.dom.Element; */ public class JobParser extends AbstractSingleBeanDefinitionParser { - private JobExecutionListenerParser jobListenerParser = new JobExecutionListenerParser(); + private static final JobExecutionListenerParser jobListenerParser = new JobExecutionListenerParser(); @Override protected Class getBeanClass(Element element) { diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java index df0efc427..5de0846c0 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/xml/StandaloneStepParser.java @@ -37,7 +37,6 @@ public class StandaloneStepParser extends AbstractStepParser { * @param parserContext the parser context for the bean factory */ public AbstractBeanDefinition parse(Element element, ParserContext parserContext) { - String jobRepositoryRef = element.getAttribute("job-repository"); - return parseTasklet(element, parserContext, jobRepositoryRef); + return parseStep(element, parserContext, null); } } 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 6a5ba553d..53f5a7c01 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 @@ -127,7 +127,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { // // Additional // - private boolean hasTaskletElement = false; + private boolean hasChunkTaskletElement = false; /** * Create a {@link Step} from the configuration provided. @@ -135,8 +135,9 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { * @see FactoryBean#getObject() */ public final Object getObject() throws Exception { - if (hasTaskletElement) { - Assert.isNull(tasklet, "Step [" + name + "] has both a element and a 'tasklet' attribute."); + if (hasChunkTaskletElement) { + Assert.isNull(tasklet, "Step [" + name + + "] has both a element and a 'ref' attribute referencing a Tasklet."); if (isFaultTolerant()) { FaultTolerantStepFactoryBean fb = new FaultTolerantStepFactoryBean(); @@ -158,7 +159,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { } else { throw new IllegalStateException("Step [" + name - + "] has neither a element nor a 'tasklet' attribute."); + + "] has neither a element nor a 'ref' attribute referencing a Tasklet."); } } @@ -281,9 +282,9 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { ts.setTransactionAttribute(new DefaultTransactionAttribute(attribute) { /** - * Ignore the default behaviour and rollback on all exceptions that - * bubble up to the tasklet level. The tasklet has to deal with the - * rollback rules internally. + * Ignore the default behaviour and rollback on all exceptions + * that bubble up to the tasklet level. The tasklet has to deal + * with the rollback rules internally. */ @Override public boolean rollbackOn(Throwable ex) { @@ -470,7 +471,7 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { * {@link MapRetryContextCache}.
* * @param cacheCapacity the cache capacity to set (greater than 0 else - * ignored) + * ignored) */ public void setCacheCapacity(int cacheCapacity) { this.cacheCapacity = cacheCapacity; @@ -596,9 +597,11 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { public void setRetryableExceptionClasses(Collection> retryableExceptionClasses) { this.retryableExceptionClasses = retryableExceptionClasses; } - + /** - * Exception classes that may not cause a rollback if encountered in the right place. + * Exception classes that may not cause a rollback if encountered in the + * right place. + * * @param noRollbackExceptionClasses the noRollbackExceptionClasses to set */ public void setNoRollbackExceptionClasses(Collection> noRollbackExceptionClasses) { @@ -626,9 +629,9 @@ class StepParserStepFactoryBean implements FactoryBean, BeanNameAware { } /** - * @param hasTaskletElement + * @param hasChunkTaskletElement */ - public void setHasTaskletElement(boolean hasTaskletElement) { - this.hasTaskletElement = hasTaskletElement; + public void setHasChunkTaskletElement(boolean hasChunkTaskletElement) { + this.hasChunkTaskletElement = hasChunkTaskletElement; } } diff --git a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd index 6d3e1a732..ffeb3a30d 100644 --- a/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd +++ b/spring-batch-core/src/main/resources/org/springframework/batch/core/configuration/xml/spring-batch-2.0.xsd @@ -69,7 +69,7 @@ - + Defines a stage in job processing backed by a @@ -78,6 +78,22 @@ to form a Job flow. + + + + + + + + + + + + + + + + @@ -163,17 +179,25 @@ - + Defines a stage in job processing backed by a Step. The id attribute must be specified. The - step requires either a tasklet definition, a - tasklet reference, a reference to a step defined - elsewhere, or a reference to a (possibly - abstract) parent step. + step requires either a chunk-tasklet definition, + a tasklet reference, or a reference to a + (possibly abstract) parent step. + + + + + + + + + @@ -239,31 +263,9 @@ - + - - - - - - - - - - - - - - - - - - - - - - - + @@ -284,7 +286,34 @@ - + + + + The tasklet is a reference to another bean definition that implements the Tasklet interface. + + + + + + + + + + + + + + + + + + + + @@ -331,7 +360,7 @@ - + @@ -741,36 +770,6 @@ - - - - - The tasklet is a reference to another bean definition that implements the Tasklet interface. - - - - - - - - - - - - - - - - - - - - - diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletElementParserTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParserTests.java similarity index 89% rename from spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletElementParserTests.java rename to spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParserTests.java index 870cf49b8..7217fbd09 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/TaskletElementParserTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/xml/ChunkTaskletParserTests.java @@ -41,15 +41,15 @@ import org.springframework.test.util.ReflectionTestUtils; * @author Dan Garrette * @since 2.0 */ -public class TaskletElementParserTests { +public class ChunkTaskletParserTests { - private ConfigurableApplicationContext taskletElementParentAttributeParserTestsContext = new ClassPathXmlApplicationContext( - "org/springframework/batch/core/configuration/xml/TaskletElementParentAttributeParserTests-context.xml"); + private ConfigurableApplicationContext chunkTaskletParentAttributeParserTestsContext = new ClassPathXmlApplicationContext( + "org/springframework/batch/core/configuration/xml/ChunkTaskletParentAttributeParserTests-context.xml"); @Test public void testInheritSkippable() throws Exception { Collection> skippable = getExceptionClasses("s1", "skippable", - taskletElementParentAttributeParserTestsContext); + chunkTaskletParentAttributeParserTestsContext); assertEquals(2, skippable.size()); boolean e = false; boolean f = false; @@ -67,7 +67,7 @@ public class TaskletElementParserTests { @Test public void testInheritFatal() throws Exception { - Collection> fatal = getExceptionClasses("s1", "fatal", taskletElementParentAttributeParserTestsContext); + Collection> fatal = getExceptionClasses("s1", "fatal", chunkTaskletParentAttributeParserTestsContext); boolean a = false; boolean b = false; for (Class cls : fatal) { @@ -84,7 +84,7 @@ public class TaskletElementParserTests { @Test public void testInheritStreams() throws Exception { - Collection streams = getStreams("s1", taskletElementParentAttributeParserTestsContext); + Collection streams = getStreams("s1", chunkTaskletParentAttributeParserTestsContext); assertEquals(2, streams.size()); boolean c = false; for (ItemStream o : streams) { @@ -98,7 +98,7 @@ public class TaskletElementParserTests { @Test public void testInheritRetryListeners() throws Exception { Collection retryListeners = getRetryListeners("s1", - taskletElementParentAttributeParserTestsContext); + chunkTaskletParentAttributeParserTestsContext); assertEquals(2, retryListeners.size()); boolean g = false; boolean h = false; @@ -117,7 +117,7 @@ public class TaskletElementParserTests { @Test public void testInheritSkippable_NoMerge() throws Exception { Collection> skippable = getExceptionClasses("s2", "skippable", - taskletElementParentAttributeParserTestsContext); + chunkTaskletParentAttributeParserTestsContext); assertEquals(1, skippable.size()); boolean e = false; for (Class cls : skippable) { @@ -130,7 +130,7 @@ public class TaskletElementParserTests { @Test public void testInheritFatal_NoMerge() throws Exception { - Collection> fatal = getExceptionClasses("s2", "fatal", taskletElementParentAttributeParserTestsContext); + Collection> fatal = getExceptionClasses("s2", "fatal", chunkTaskletParentAttributeParserTestsContext); boolean a = false; boolean b = false; for (Class cls : fatal) { @@ -147,7 +147,7 @@ public class TaskletElementParserTests { @Test public void testInheritStreams_NoMerge() throws Exception { - Collection streams = getStreams("s2", taskletElementParentAttributeParserTestsContext); + Collection streams = getStreams("s2", chunkTaskletParentAttributeParserTestsContext); assertEquals(1, streams.size()); boolean c = false; for (ItemStream o : streams) { @@ -161,7 +161,7 @@ public class TaskletElementParserTests { @Test public void testInheritRetryListeners_NoMerge() throws Exception { Collection retryListeners = getRetryListeners("s2", - taskletElementParentAttributeParserTestsContext); + chunkTaskletParentAttributeParserTestsContext); assertEquals(1, retryListeners.size()); boolean h = false; for (RetryListener o : retryListeners) { 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 15b93e977..08ff17dec 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 @@ -146,7 +146,7 @@ public class StepParserStepFactoryBeanTests { @Test public void testSimpleStep() throws Exception { StepParserStepFactoryBean fb = new StepParserStepFactoryBean(); - fb.setHasTaskletElement(true); + fb.setHasChunkTaskletElement(true); fb.setBeanName("step1"); fb.setAllowStartIfComplete(true); fb.setJobRepository(new JobRepositorySupport()); @@ -162,7 +162,7 @@ public class StepParserStepFactoryBeanTests { fb.setItemProcessor(new PassThroughItemProcessor()); fb.setItemWriter(new DummyItemWriter()); fb.setStreams(new ItemStream[] { new FlatFileItemReader() }); - + Object step = fb.getObject(); assertTrue(step instanceof TaskletStep); Object tasklet = ReflectionTestUtils.getField(step, "tasklet"); @@ -172,7 +172,7 @@ public class StepParserStepFactoryBeanTests { @Test public void testFaultTolerantStep() throws Exception { StepParserStepFactoryBean fb = new StepParserStepFactoryBean(); - fb.setHasTaskletElement(true); + fb.setHasChunkTaskletElement(true); fb.setBeanName("step1"); fb.setAllowStartIfComplete(true); fb.setJobRepository(new JobRepositorySupport()); diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml index c0096e7de..ce13738f5 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml @@ -7,7 +7,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml index 2390ccce0..b0024a1a1 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml @@ -6,7 +6,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkTaskletParentAttributeParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkTaskletParentAttributeParserTests-context.xml new file mode 100644 index 000000000..dd9ebde48 --- /dev/null +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/ChunkTaskletParentAttributeParserTests-context.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + java.lang.NullPointerException + + + org.springframework.dao.CannotAcquireLockException + + + + + + + + + + + + + + + + java.lang.NullPointerException + + + org.springframework.dao.CannotAcquireLockException + + + + + + + + + + + + + + + + + java.lang.ArithmeticException + + + org.springframework.dao.DeadlockLoserDataAccessException + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserParentAttributeTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserParentAttributeTests-context.xml index d4e7da248..2b52350ac 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserParentAttributeTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/JobParserParentAttributeTests-context.xml @@ -7,7 +7,9 @@ - + + + @@ -15,7 +17,9 @@ - + + + @@ -23,7 +27,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerParserTests-context.xml index 7b8f6685b..a1270b1ad 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerParserTests-context.xml @@ -7,18 +7,22 @@ - - - - - + + + + + + + - - - - - + + + + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml index b477a3d73..d01d76e19 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadRetryListenerTests-context.xml @@ -8,25 +8,28 @@ - - - - - - - - - org.springframework.dao.DataIntegrityViolationException, - + + + + + + + + + + org.springframework.dao.DataIntegrityViolationException, + + + + + org.springframework.dao.DataIntegrityViolationException + + + + - - - org.springframework.dao.DataIntegrityViolationException - - - - diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadStepListenerTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadStepListenerTests-context.xml index 90d7b66e9..163ce5466 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadStepListenerTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBadStepListenerTests-context.xml @@ -7,10 +7,12 @@ - - - - + + + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml index d4c170986..edff1125e 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml @@ -8,8 +8,10 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml index 9dad4bb5b..35694bace 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml @@ -8,8 +8,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml index a9c3c247a..5a7ea02a4 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml @@ -8,8 +8,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserNoCommitIntervalOrCompletionPolicyTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserNoCommitIntervalOrCompletionPolicyTests-context.xml index 523878166..edb75150c 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserNoCommitIntervalOrCompletionPolicyTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserNoCommitIntervalOrCompletionPolicyTests-context.xml @@ -8,7 +8,9 @@ - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml index 1d2e6ea45..74449c173 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml @@ -8,47 +8,65 @@ - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - + + + + - - - - + + + + + + \ No newline at end of file diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml index feb249ed1..d3427bb30 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml @@ -5,29 +5,32 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> - - - - - - - - - - org.springframework.jdbc.BadSqlGrammarException - - - org.springframework.dao.DataIntegrityViolationException - + + + + + + + + + + + org.springframework.jdbc.BadSqlGrammarException + + + org.springframework.dao.DataIntegrityViolationException + + + + + org.springframework.dao.DataIntegrityViolationException + + + + - - - org.springframework.dao.DataIntegrityViolationException - - - - diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithBasicProcessTaskJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithBasicProcessTaskJobParserTests-context.xml index 4ac8af32c..fa09b704f 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithBasicProcessTaskJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithBasicProcessTaskJobParserTests-context.xml @@ -8,17 +8,19 @@ - - - - + + + + + + + + + + - - - - diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml index f96cce0a6..f144ab264 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml @@ -8,27 +8,29 @@ - - - - - - - - - + + + + + + + + + + + org.springframework.dao.DataIntegrityViolationException + + + + org.springframework.dao.DataIntegrityViolationException - + + + + + - - - org.springframework.dao.DataIntegrityViolationException - - - - - diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests-context.xml index 96dd2fd8e..40779ed65 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests-context.xml @@ -7,13 +7,16 @@ - + + - - - - + + + + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml index 207b5a047..990f38c8f 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml @@ -7,8 +7,9 @@ - - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml index 3d8bb2589..190af67ca 100644 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml +++ b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml @@ -9,8 +9,9 @@ - - + + + diff --git a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletElementParentAttributeParserTests-context.xml b/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletElementParentAttributeParserTests-context.xml deleted file mode 100644 index 873b64bc6..000000000 --- a/spring-batch-core/src/test/resources/org/springframework/batch/core/configuration/xml/TaskletElementParentAttributeParserTests-context.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - java.lang.NullPointerException - - - org.springframework.dao.CannotAcquireLockException - - - - - - - - - - - - - - java.lang.NullPointerException - - - org.springframework.dao.CannotAcquireLockException - - - - - - - - - - - - - - - java.lang.ArithmeticException - - - org.springframework.dao.DeadlockLoserDataAccessException - - - - - - - - - - - - - - \ No newline at end of file diff --git a/spring-batch-samples/src/main/resources/jobs/adhocLoopJob.xml b/spring-batch-samples/src/main/resources/jobs/adhocLoopJob.xml index 042d58bde..d0905aaba 100644 --- a/spring-batch-samples/src/main/resources/jobs/adhocLoopJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/adhocLoopJob.xml @@ -15,7 +15,9 @@ - + + + @@ -23,7 +25,7 @@ + class="org.springframework.batch.sample.common.InfiniteLoopIncrementer"/> diff --git a/spring-batch-samples/src/main/resources/jobs/beanWrapperMapperSampleJob.xml b/spring-batch-samples/src/main/resources/jobs/beanWrapperMapperSampleJob.xml index d5f526ee0..2c7b3545a 100644 --- a/spring-batch-samples/src/main/resources/jobs/beanWrapperMapperSampleJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/beanWrapperMapperSampleJob.xml @@ -10,10 +10,15 @@ - + + + - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/compositeItemWriterSampleJob.xml b/spring-batch-samples/src/main/resources/jobs/compositeItemWriterSampleJob.xml index 3d40ae9d3..993db2071 100644 --- a/spring-batch-samples/src/main/resources/jobs/compositeItemWriterSampleJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/compositeItemWriterSampleJob.xml @@ -17,12 +17,15 @@ - - - - - - + + + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/customerFilterJob.xml b/spring-batch-samples/src/main/resources/jobs/customerFilterJob.xml index 6ba952958..f9dd68333 100644 --- a/spring-batch-samples/src/main/resources/jobs/customerFilterJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/customerFilterJob.xml @@ -9,13 +9,15 @@ - - - - + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/delegatingJob.xml b/spring-batch-samples/src/main/resources/jobs/delegatingJob.xml index 89e0ffb86..bf91e5d5d 100644 --- a/spring-batch-samples/src/main/resources/jobs/delegatingJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/delegatingJob.xml @@ -19,7 +19,9 @@ - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/footballJob.xml b/spring-batch-samples/src/main/resources/jobs/footballJob.xml index e324bee00..5b389273a 100644 --- a/spring-batch-samples/src/main/resources/jobs/footballJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/footballJob.xml @@ -13,19 +13,25 @@ - + + + - + + + - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/headerFooterSample.xml b/spring-batch-samples/src/main/resources/jobs/headerFooterSample.xml index 47ea26bf0..f826a0ff8 100644 --- a/spring-batch-samples/src/main/resources/jobs/headerFooterSample.xml +++ b/spring-batch-samples/src/main/resources/jobs/headerFooterSample.xml @@ -14,16 +14,17 @@ - - - - - + + + + + + + + + + - - - - diff --git a/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml b/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml index ce1794258..1e2b4aca9 100644 --- a/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/hibernateJob.xml @@ -12,18 +12,21 @@ - + + + - + + class="org.springframework.batch.sample.domain.trade.internal.HibernateAwareCustomerCreditItemWriter"> diff --git a/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml b/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml index 2224154ab..862e54e2a 100644 --- a/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/ioSampleJob.xml @@ -15,7 +15,9 @@ - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/iosample/multiLine.xml b/spring-batch-samples/src/main/resources/jobs/iosample/multiLine.xml index 6a96ca97d..fbea07b00 100644 --- a/spring-batch-samples/src/main/resources/jobs/iosample/multiLine.xml +++ b/spring-batch-samples/src/main/resources/jobs/iosample/multiLine.xml @@ -15,7 +15,9 @@ - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/iosample/multiRecordType.xml b/spring-batch-samples/src/main/resources/jobs/iosample/multiRecordType.xml index 1926f5162..a9608a535 100644 --- a/spring-batch-samples/src/main/resources/jobs/iosample/multiRecordType.xml +++ b/spring-batch-samples/src/main/resources/jobs/iosample/multiRecordType.xml @@ -15,7 +15,9 @@ - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/loopFlowSample.xml b/spring-batch-samples/src/main/resources/jobs/loopFlowSample.xml index 27a39a868..6a6cc9897 100644 --- a/spring-batch-samples/src/main/resources/jobs/loopFlowSample.xml +++ b/spring-batch-samples/src/main/resources/jobs/loopFlowSample.xml @@ -13,17 +13,20 @@ - - - - + + + + + + - - - - - + + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/multilineJob.xml b/spring-batch-samples/src/main/resources/jobs/multilineJob.xml index ae3e8ff5e..c602c1bbf 100644 --- a/spring-batch-samples/src/main/resources/jobs/multilineJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/multilineJob.xml @@ -12,10 +12,12 @@ - - - - + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/multilineOrderJob.xml b/spring-batch-samples/src/main/resources/jobs/multilineOrderJob.xml index af791ada6..638f8396e 100644 --- a/spring-batch-samples/src/main/resources/jobs/multilineOrderJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/multilineOrderJob.xml @@ -14,11 +14,13 @@ - - - - - + + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/parallelJob.xml b/spring-batch-samples/src/main/resources/jobs/parallelJob.xml index 008f794df..2685dd5cf 100644 --- a/spring-batch-samples/src/main/resources/jobs/parallelJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/parallelJob.xml @@ -13,17 +13,21 @@ - + + + - + + + diff --git a/spring-batch-samples/src/main/resources/jobs/partitionJob.xml b/spring-batch-samples/src/main/resources/jobs/partitionJob.xml index effbd3fdb..9065db3f0 100644 --- a/spring-batch-samples/src/main/resources/jobs/partitionJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/partitionJob.xml @@ -9,11 +9,10 @@ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> - - - - - + + + + @@ -37,11 +36,13 @@ - - - - - + + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/restartSample.xml b/spring-batch-samples/src/main/resources/jobs/restartSample.xml index cec7feb18..7edb570af 100644 --- a/spring-batch-samples/src/main/resources/jobs/restartSample.xml +++ b/spring-batch-samples/src/main/resources/jobs/restartSample.xml @@ -10,10 +10,12 @@ - - - - + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/retrySample.xml b/spring-batch-samples/src/main/resources/jobs/retrySample.xml index c1d8fc3b9..50e51a6f4 100644 --- a/spring-batch-samples/src/main/resources/jobs/retrySample.xml +++ b/spring-batch-samples/src/main/resources/jobs/retrySample.xml @@ -13,13 +13,15 @@ - - - java.lang.Exception - + + + + java.lang.Exception + + diff --git a/spring-batch-samples/src/main/resources/jobs/skipSampleJob.xml b/spring-batch-samples/src/main/resources/jobs/skipSampleJob.xml index 222e5581c..67b724e17 100644 --- a/spring-batch-samples/src/main/resources/jobs/skipSampleJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/skipSampleJob.xml @@ -13,9 +13,11 @@ http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> - - + + + + @@ -23,7 +25,9 @@ - + + + @@ -33,33 +37,41 @@ - + + + - - - java.lang.RuntimeException - + + + + java.lang.RuntimeException + + - - - org.springframework.batch.item.validator.ValidationException - + + + + org.springframework.batch.item.validator.ValidationException + + - - - - + + + + + + diff --git a/spring-batch-samples/src/main/resources/jobs/tradeJob.xml b/spring-batch-samples/src/main/resources/jobs/tradeJob.xml index d539cf303..5fbce155f 100644 --- a/spring-batch-samples/src/main/resources/jobs/tradeJob.xml +++ b/spring-batch-samples/src/main/resources/jobs/tradeJob.xml @@ -11,18 +11,25 @@ - - - - + + + + + + + - - + + + - + + +