RESOLVED - issue BATCH-1496: Expose retry-policy in namespace configuration

This commit is contained in:
dsyer
2010-01-30 10:28:57 +00:00
parent 5512054289
commit d8cc4d105d
6 changed files with 126 additions and 17 deletions

View File

@@ -107,6 +107,9 @@ public class ChunkElementParser {
handleItemHandler("skip-policy", "skipPolicy", null, false, element, parserContext,
propertyValues, underspecified);
handleItemHandler("retry-policy", "retryPolicy", null, false, element, parserContext,
propertyValues, underspecified);
String retryLimit = element.getAttribute("retry-limit");
if (StringUtils.hasText(retryLimit)) {
propertyValues.addPropertyValue("retryLimit", retryLimit);

View File

@@ -525,7 +525,7 @@ class StepParserStepFactoryBean<I, O> implements FactoryBean, BeanNameAware {
}
private boolean isFaultTolerant() {
return backOffPolicy != null || skipPolicy != null || isPositive(skipLimit) || isPositive(retryLimit)
return backOffPolicy != null || skipPolicy != null || retryPolicy != null || isPositive(skipLimit) || isPositive(retryLimit)
|| isPositive(cacheCapacity) || isTrue(readerTransactionalQueue);
}

View File

@@ -721,6 +721,18 @@
<xsd:attributeGroup ref="adapterMethodAttribute" />
</xsd:complexType>
</xsd:element>
<xsd:element name="retry-policy" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation><![CDATA[
The RetryPolicy used by the step. If specified then the retry limit and retryable exceptions are ignored
]]>
</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:group ref="beanElementGroup" minOccurs="0" maxOccurs="1" />
<xsd:attributeGroup ref="adapterMethodAttribute" />
</xsd:complexType>
</xsd:element>
<xsd:element name="retry-listeners" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation><![CDATA[
@@ -852,6 +864,17 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="retry-policy" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[
The retry policy to use. If specified then the retry limit and retryable exceptions are ignored.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref" />
<tool:expected-type type="org.springframework.batch.retry.RetryPolicy" />
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
<xsd:attribute name="retry-limit" type="xsd:string" use="optional">
<xsd:annotation>
<xsd:documentation><![CDATA[