Moved the fist namespace to execution from core

This commit is contained in:
nebhale
2008-02-18 15:21:33 +00:00
parent 5ed0a9cfc6
commit 0b3f025707
5 changed files with 49 additions and 2 deletions

View File

@@ -0,0 +1,24 @@
package org.springframework.batch.execution.configuration;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
* <code>NamespaceHandler</code> for the <code>batch</code> namespace.
*
* <p>Provides a {@link BeanDefinitionParser} for the <code>&lt;batch:job&gt;</code> tag. A <code>job</code>
* tag can include nested <code>chunked-step</code> and <code>tasklet-step</code> tags.
*
* @author Ben Hale
*/
public class BatchCoreNamespaceHandler extends NamespaceHandlerSupport {
/**
* Register the {@link BeanDefinitionParser BeanDefinitionParser} for the
* '<code>job</code>', tag.
*/
public void init() {
registerBeanDefinitionParser("job", new JobBeanDefinitionParser());
}
}

View File

@@ -0,0 +1,21 @@
package org.springframework.batch.execution.configuration;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
import org.w3c.dom.Element;
class JobBeanDefinitionParser implements BeanDefinitionParser {
private static final String JOB = "job";
private static final String CHUNKING_STEP = "chunking-step";
private static final String TASKLET_STEP ="tasklet-step";
public BeanDefinition parse(Element element, ParserContext parserContext) {
// TODO Auto-generated method stub
throw new UnsupportedOperationException();
}
}

View File

@@ -0,0 +1 @@
http\://www.springframework.org/schema/batch-execution=org.springframework.batch.execution.config.BatchCoreNamespaceHandler

View File

@@ -0,0 +1 @@
http\://www.springframework.org/schema/batch/spring-batch-execution-1.0.xsd=org/springframework/batch/core/config/spring-batch-execution-1.0.xsd

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="http://www.springframework.org/schema/batch-execution"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.springframework.org/schema/batch-execution"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
<xs:element name="job">
<xs:annotation>
<xs:documentation><![CDATA[Defines a uniquely identified job that is referenced at runtime.]]></xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:element name="chunk-step" type="chunkStepType">
<xs:annotation>
<xs:documentation><![CDATA[Defines a step that supports chunking]]></xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="tasklet-step" type="taskletStepType">
<xs:annotation>
<xs:documentation><![CDATA[Defines a step that executes a tasklet]]></xs:documentation>
</xs:annotation>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- Types -->
<xs:complexType name="chunkStepType">
<xs:attribute name="id" type="xs:string" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The unique identifier to use in this step. The id must be unique within the context of this job.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="size" type="xs:positiveInteger" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The number of elements to be processed per chunk. This must be a number greater than 0.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="item-reader" type="xs:string" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The id of the ItemReader implementation to read from in this step]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="item-writer" type="xs:string" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The id of the ItemWriter implementation to write to in this step]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="transaction-manager" type="xs:string" use="optional"
default="transaction-manager">
<xs:annotation>
<xs:documentation><![CDATA[The id of the transaction manager to use in this step. This should be an implementation of Spring's PlatformTransactionManager.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="rerun.enum"/>
<xs:attribute name="input-skip-limit" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation><![CDATA[The maximum number of items the ItemReader can skip before this step is marked as a failure. The default is no limit.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="output-skip-limit" type="xs:nonNegativeInteger" use="optional">
<xs:annotation>
<xs:documentation><![CDATA[The maximum number of items the ItemWriter can skip before this step is marked as a failure. The default is no limit.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="taskletStepType">
<xs:attribute name="id" type="xs:string" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The unique identifier to use in this step. The id must be unique within the context of this job.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="tasklet" type="xs:string" use="required">
<xs:annotation>
<xs:documentation><![CDATA[The id of the Tasklet implementation to execute in this step.]]></xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attributeGroup ref="rerun.enum"/>
</xs:complexType>
<!-- Enumerations -->
<xs:attributeGroup name="rerun.enum">
<xs:attribute name="rerun" use="optional">
<xs:annotation>
<xs:documentation><![CDATA[When to re-run this step. The default is 'incomplete.
* always: Always re-run this step
* never: Never re-run this step
* incomplete: Re-run this step whenever a previous execution was incomplete]]></xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="always"/>
<xs:enumeration value="never"/>
<xs:enumeration value="complete"/>
<xs:enumeration value="incomplete"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:attributeGroup>
</xs:schema>