[BATCH-63] <step/> tag of namespace complete
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.batch.execution.configuration;
|
||||
|
||||
import org.springframework.batch.execution.step.ItemOrientedStep;
|
||||
import org.springframework.batch.execution.step.TaskletStep;
|
||||
import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.beans.factory.config.BeanDefinition;
|
||||
@@ -37,7 +38,7 @@ class JobBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String TAG_JOB = "job";
|
||||
|
||||
private static final String TAG_CHUNKING_STEP = "chunking-step";
|
||||
private static final String TAG_STEP = "step";
|
||||
|
||||
private static final String TAG_TASKLET_STEP = "tasklet-step";
|
||||
|
||||
@@ -63,14 +64,39 @@ class JobBeanDefinitionParser implements BeanDefinitionParser {
|
||||
|
||||
private static final String REPOSITORY_BEAN_NAME = "_jobRepository";
|
||||
|
||||
private static final String ATT_SIZE = "size";
|
||||
|
||||
private static final String PROP_COMMIT_INTERVAL = "commitInterval";
|
||||
|
||||
private static final String ATT_TRANSACTION_MANAGER = "transaction-manager";
|
||||
|
||||
private static final String PROP_TRANSACTION_MANAGER = "transactionManager";
|
||||
|
||||
private static final String ATT_ITEM_READER = "item-reader";
|
||||
|
||||
private static final String PROP_ITEM_READER = "itemReader";
|
||||
|
||||
private static final String ATT_ITEM_WRITER = "item-writer";
|
||||
|
||||
private static final String PROP_ITEM_WRITER = "itemWriter";
|
||||
|
||||
private static final String ATT_INPUT_SKIP_LIMIT = "input-skip-limit";
|
||||
|
||||
// TODO: Create difference between input skip limit and output skip limit
|
||||
private static final String PROP_INPUT_SKIP_LIMIT = "skipLimit";
|
||||
|
||||
private static final String ATT_OUTPUT_SKIP_LIMIT = "output-skip-limit";
|
||||
|
||||
private static final String PROP_OUTPUT_SKIP_LIMIT = "outputSkipLimit";
|
||||
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
NodeList childNodes = element.getChildNodes();
|
||||
for (int i = 0; i < childNodes.getLength(); i++) {
|
||||
Node node = childNodes.item(i);
|
||||
if (node.getNodeType() == Node.ELEMENT_NODE) {
|
||||
String localName = node.getLocalName();
|
||||
if (TAG_CHUNKING_STEP.equals(localName)) {
|
||||
// parseChunkingStep((Element) node, parserContext);
|
||||
if (TAG_STEP.equals(localName)) {
|
||||
parseStep((Element) node, parserContext);
|
||||
} else if (TAG_TASKLET_STEP.equals(localName)) {
|
||||
parseTaskletStep((Element) node, parserContext);
|
||||
}
|
||||
@@ -79,6 +105,61 @@ class JobBeanDefinitionParser implements BeanDefinitionParser {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void parseStep(Element stepElement, ParserContext parserContext) {
|
||||
AbstractBeanDefinition stepDef = createStepBeanDefinition(stepElement, parserContext);
|
||||
String id = stepElement.getAttribute(ATT_ID);
|
||||
|
||||
if (StringUtils.hasText(id)) {
|
||||
parserContext.getRegistry().registerBeanDefinition(id, stepDef);
|
||||
} else {
|
||||
parserContext.getReaderContext().registerWithGeneratedName(stepDef);
|
||||
}
|
||||
}
|
||||
|
||||
private AbstractBeanDefinition createStepBeanDefinition(Element stepElement, ParserContext parserContext) {
|
||||
RootBeanDefinition stepDef = new RootBeanDefinition(ItemOrientedStep.class);
|
||||
stepDef.setSource(parserContext.extractSource(stepElement));
|
||||
MutablePropertyValues propertyValues = stepDef.getPropertyValues();
|
||||
|
||||
String size = stepElement.getAttribute(ATT_SIZE);
|
||||
propertyValues.addPropertyValue(PROP_COMMIT_INTERVAL, Integer.valueOf(size));
|
||||
String transactionManager = stepElement.getAttribute(ATT_TRANSACTION_MANAGER);
|
||||
if (!StringUtils.hasText(transactionManager)) {
|
||||
parserContext.getReaderContext().error("'transaction-manager' attribute contains empty value", stepElement);
|
||||
} else {
|
||||
propertyValues.addPropertyValue(PROP_TRANSACTION_MANAGER, new RuntimeBeanReference(transactionManager));
|
||||
}
|
||||
|
||||
String itemReader = stepElement.getAttribute(ATT_ITEM_READER);
|
||||
if (!StringUtils.hasText(itemReader)) {
|
||||
parserContext.getReaderContext().error("'item-reader' attribute contains empty value", stepElement);
|
||||
} else {
|
||||
propertyValues.addPropertyValue(PROP_ITEM_READER, new RuntimeBeanReference(itemReader));
|
||||
}
|
||||
String itemWriter = stepElement.getAttribute(ATT_ITEM_WRITER);
|
||||
if (!StringUtils.hasText(itemWriter)) {
|
||||
parserContext.getReaderContext().error("'item-writer' attribute contains empty value", stepElement);
|
||||
} else {
|
||||
propertyValues.addPropertyValue(PROP_ITEM_WRITER, new RuntimeBeanReference(itemWriter));
|
||||
}
|
||||
|
||||
if (stepElement.hasAttribute(ATT_INPUT_SKIP_LIMIT)) {
|
||||
String inputSkipLimit = stepElement.getAttribute(ATT_INPUT_SKIP_LIMIT);
|
||||
propertyValues.addPropertyValue(PROP_INPUT_SKIP_LIMIT, Integer.valueOf(inputSkipLimit));
|
||||
}
|
||||
|
||||
// TODO: Create difference between input skip limit and output skip limit
|
||||
// if (stepElement.hasAttribute(ATT_OUTPUT_SKIP_LIMIT)) {
|
||||
// String outputSkipLimit = stepElement.getAttribute(ATT_OUTPUT_SKIP_LIMIT);
|
||||
// propertyValues.addPropertyValue(PROP_OUTPUT_SKIP_LIMIT, Integer.valueOf(outputSkipLimit));
|
||||
// }
|
||||
|
||||
String rerun = stepElement.getAttribute(ATT_RERUN);
|
||||
setPropertiesForRerun(rerun, propertyValues);
|
||||
propertyValues.addPropertyValue(PROP_JOB_REPOSITORY, new RuntimeBeanReference(REPOSITORY_BEAN_NAME));
|
||||
return stepDef;
|
||||
}
|
||||
|
||||
private void parseTaskletStep(Element taskletElement, ParserContext parserContext) {
|
||||
AbstractBeanDefinition stepDef = createTaskletStepBeanDefinition(taskletElement, parserContext);
|
||||
String id = taskletElement.getAttribute(ATT_ID);
|
||||
@@ -93,18 +174,18 @@ class JobBeanDefinitionParser implements BeanDefinitionParser {
|
||||
private AbstractBeanDefinition createTaskletStepBeanDefinition(Element taskletElement, ParserContext parserContext) {
|
||||
RootBeanDefinition stepDef = new RootBeanDefinition(TaskletStep.class);
|
||||
stepDef.setSource(parserContext.extractSource(taskletElement));
|
||||
MutablePropertyValues propertyValues = stepDef.getPropertyValues();
|
||||
|
||||
String tasklet = taskletElement.getAttribute(ATT_TASKLET);
|
||||
if (!StringUtils.hasText(tasklet)) {
|
||||
parserContext.getReaderContext().error("'tasklet' attribute contains empty value", taskletElement);
|
||||
} else {
|
||||
stepDef.getPropertyValues().addPropertyValue(PROP_TASKLET, new RuntimeBeanReference(tasklet));
|
||||
propertyValues.addPropertyValue(PROP_TASKLET, new RuntimeBeanReference(tasklet));
|
||||
}
|
||||
|
||||
String rerun = taskletElement.getAttribute(ATT_RERUN);
|
||||
setPropertiesForRerun(rerun, stepDef.getPropertyValues());
|
||||
stepDef.getPropertyValues().addPropertyValue(PROP_JOB_REPOSITORY,
|
||||
new RuntimeBeanReference(REPOSITORY_BEAN_NAME));
|
||||
setPropertiesForRerun(rerun, propertyValues);
|
||||
propertyValues.addPropertyValue(PROP_JOB_REPOSITORY, new RuntimeBeanReference(REPOSITORY_BEAN_NAME));
|
||||
|
||||
return stepDef;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,8 @@ import org.springframework.util.StringUtils;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
/**
|
||||
* Creates a {@link BeanDefinitionParser} for the <code><job-repository></code> tag.
|
||||
*
|
||||
* @author Ben Hale
|
||||
*/
|
||||
class JobRepositoryBeanDefinitionParser implements BeanDefinitionParser {
|
||||
@@ -151,16 +153,17 @@ class JobRepositoryBeanDefinitionParser implements BeanDefinitionParser {
|
||||
return incrementerDef;
|
||||
}
|
||||
|
||||
private void addSequenceIncrementer(String dataSourceId, String incrementerName,
|
||||
ConstructorArgumentValues constructorArgumentValues) {
|
||||
constructorArgumentValues.addGenericArgumentValue(new RuntimeBeanReference(dataSourceId));
|
||||
private void addSequenceIncrementer(String dataSourceId, String incrementerName,
|
||||
ConstructorArgumentValues constructorArgumentValues) {
|
||||
constructorArgumentValues.addGenericArgumentValue(new RuntimeBeanReference(dataSourceId));
|
||||
constructorArgumentValues.addGenericArgumentValue(incrementerName);
|
||||
}
|
||||
|
||||
private void addTableIncrementer(String dataSourceId, String incrementerName, ConstructorArgumentValues constructorArgumentValues) {
|
||||
constructorArgumentValues.addGenericArgumentValue(new RuntimeBeanReference(dataSourceId));
|
||||
}
|
||||
|
||||
private void addTableIncrementer(String dataSourceId, String incrementerName,
|
||||
ConstructorArgumentValues constructorArgumentValues) {
|
||||
constructorArgumentValues.addGenericArgumentValue(new RuntimeBeanReference(dataSourceId));
|
||||
constructorArgumentValues.addGenericArgumentValue(incrementerName);
|
||||
constructorArgumentValues.addGenericArgumentValue("id");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
</xs:annotation>
|
||||
<xs:complexType>
|
||||
<xs:choice minOccurs="1" maxOccurs="unbounded">
|
||||
<xs:element name="chunk-step" type="chunkStepType">
|
||||
<xs:element name="step" type="stepType">
|
||||
<xs:annotation>
|
||||
<xs:documentation><![CDATA[Defines a step that supports chunking]]></xs:documentation>
|
||||
</xs:annotation>
|
||||
@@ -58,7 +58,7 @@
|
||||
</xs:element>
|
||||
|
||||
<!-- Types -->
|
||||
<xs:complexType name="chunkStepType">
|
||||
<xs:complexType name="stepType">
|
||||
<xs:attribute name="id" type="xs:token" 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>
|
||||
@@ -80,7 +80,7 @@
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="transaction-manager" type="xs:token" use="optional"
|
||||
default="transaction-manager">
|
||||
default="transactionManager">
|
||||
<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>
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.execution.configuration;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.springframework.batch.execution.step.ItemOrientedStep;
|
||||
import org.springframework.beans.factory.parsing.BeanDefinitionParsingException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
public class BatchNamespaceHandlerStepTests extends TestCase {
|
||||
|
||||
private static final String PACKAGE = "org/springframework/batch/execution/configuration/";
|
||||
|
||||
public void testStepOk() {
|
||||
new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepOk.xml");
|
||||
}
|
||||
|
||||
public void testStepMissingIteamReader() {
|
||||
try {
|
||||
new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepMissingItemReader.xml");
|
||||
fail("Expected BeanDefinitionParsingException");
|
||||
} catch (BeanDefinitionParsingException e) { }
|
||||
}
|
||||
|
||||
public void testStepMissingItemWriter() {
|
||||
try {
|
||||
new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepMissingItemWriter.xml");
|
||||
fail("Expected BeanDefinitionParsingException");
|
||||
} catch (BeanDefinitionParsingException e) { }
|
||||
}
|
||||
|
||||
public void testStepMissingTransactionManager() {
|
||||
try {
|
||||
new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepMissingTransactionManager.xml");
|
||||
fail("Expected BeanDefinitionParsingException");
|
||||
} catch (BeanDefinitionParsingException e) { }
|
||||
}
|
||||
|
||||
public void testStepSpecificTransactionManager() {
|
||||
new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepSpecificTransactionManager.xml");
|
||||
}
|
||||
|
||||
public void testStepRerunAlways() {
|
||||
ApplicationContext ctx = new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepRerunAlways.xml");
|
||||
ItemOrientedStep step = (ItemOrientedStep) ctx.getBean("process");
|
||||
assertEquals(Integer.MAX_VALUE, step.getStartLimit());
|
||||
assertTrue(step.isAllowStartIfComplete());
|
||||
}
|
||||
|
||||
public void testStepRerunNever() {
|
||||
ApplicationContext ctx = new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepRerunNever.xml");
|
||||
ItemOrientedStep step = (ItemOrientedStep) ctx.getBean("process");
|
||||
assertEquals(1, step.getStartLimit());
|
||||
assertFalse(step.isAllowStartIfComplete());
|
||||
}
|
||||
|
||||
public void testStepRerunIncomplete() {
|
||||
ApplicationContext ctx = new ClassPathXmlApplicationContext(PACKAGE + "BatchNamespaceHandlerStepRerunIncomplete.xml");
|
||||
ItemOrientedStep step = (ItemOrientedStep) ctx.getBean("process");
|
||||
assertEquals(Integer.MAX_VALUE, step.getStartLimit());
|
||||
assertFalse(step.isAllowStartIfComplete());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.execution.configuration;
|
||||
|
||||
import org.springframework.batch.item.ItemReader;
|
||||
import org.springframework.batch.item.exception.MarkFailedException;
|
||||
import org.springframework.batch.item.exception.ResetFailedException;
|
||||
|
||||
public class StubItemReader implements ItemReader {
|
||||
|
||||
public void mark() throws MarkFailedException {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public Object read() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void reset() throws ResetFailedException {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.execution.configuration;
|
||||
|
||||
import org.springframework.batch.item.ItemWriter;
|
||||
|
||||
public class StubItemWriter implements ItemWriter {
|
||||
|
||||
public void clear() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void flush() throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void write(Object item) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.batch.execution.configuration;
|
||||
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
import org.springframework.transaction.TransactionDefinition;
|
||||
import org.springframework.transaction.TransactionException;
|
||||
import org.springframework.transaction.TransactionStatus;
|
||||
|
||||
public class StubTransactionManager implements PlatformTransactionManager {
|
||||
|
||||
public void commit(TransactionStatus status) throws TransactionException {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void rollback(TransactionStatus status) throws TransactionException {
|
||||
// TODO Auto-generated method stub
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="" item-writer="itemWriter"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,23 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer=""/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,23 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter" transaction-manager=""/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter" rerun="always"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter" rerun="incomplete"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter" rerun="never"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<beans:beans xmlns="http://www.springframework.org/schema/batch"
|
||||
xmlns:beans="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||
http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd">
|
||||
|
||||
<job-repository data-source="dataSource" db-type="db2"/>
|
||||
|
||||
<job id="processJob">
|
||||
<step id="process" size="10" item-reader="itemReader" item-writer="itemWriter"/>
|
||||
</job>
|
||||
|
||||
<beans:bean id="itemReader"
|
||||
class="org.springframework.batch.execution.configuration.StubItemReader"/>
|
||||
|
||||
<beans:bean id="itemWriter"
|
||||
class="org.springframework.batch.execution.configuration.StubItemWriter"/>
|
||||
|
||||
<beans:bean id="dataSource"
|
||||
class="org.springframework.batch.execution.configuration.StubDataSource"/>
|
||||
|
||||
<beans:bean id="transactionManager"
|
||||
class="org.springframework.batch.execution.configuration.StubTransactionManager"/>
|
||||
|
||||
</beans:beans>
|
||||
Reference in New Issue
Block a user