<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" 
	xmlns:util="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.xsd
					http://www.springframework.org/schema/util
					http://www.springframework.org/schema/util/spring-util.xsd
					http://www.springframework.org/schema/batch
	                http://www.springframework.org/schema/batch/spring-batch-2.2.xsd">
	                
	<bean id="step1ItemReader" class="org.springframework.batch.item.support.ListItemReader">
		<constructor-arg>
			<util:list>
				<util:value>A</util:value>
			</util:list>
		</constructor-arg>
	</bean>
	
	<bean id="step1ItemWriter" class="org.springframework.batch.core.configuration.xml.DummyItemWriter"/>
	                
	<bean id="step2ItemReader" class="org.springframework.batch.item.support.ListItemReader">
		<constructor-arg>
			<util:list>
				<util:value>A</util:value>
				<util:value>B</util:value>
			</util:list>
		</constructor-arg>
	</bean>
	
	<bean id="step2ItemWriter" class="org.springframework.batch.core.configuration.xml.DummyItemWriter"/>
	                
	<bean id="step3ItemReader" class="org.springframework.batch.item.support.ListItemReader">
		<constructor-arg>
			<util:list>
				<util:value>A</util:value>
				<util:value>B</util:value>
				<util:value>C</util:value>
			</util:list>
		</constructor-arg>
	</bean>
	
	<bean id="step3ItemWriter" class="org.springframework.batch.core.configuration.xml.DummyItemWriter"/>
	
	<bean id="decidingTasklet" class="org.springframework.batch.core.step.RestartInPriorStepTests$DecidingTasklet"/>
	
	<bean id="completionDecider" class="org.springframework.batch.core.step.RestartInPriorStepTests$CompletionDecider"/>
	                
	<job id="restartJob" xmlns="http://www.springframework.org/schema/batch">
		<step id="step1" next="step2">
			<tasklet allow-start-if-complete="true">
				<chunk reader="step1ItemReader" writer="step1ItemWriter" commit-interval="10" />
			</tasklet>
		</step>
		<step id="step2">
			<tasklet ref="decidingTasklet"/>
			<next on="ES3" to="step3"/>
			<stop on="ES4" restart="step4"/>
		</step>
		<step id="step3" next="step4">
			<tasklet>
				<chunk reader="step2ItemReader" writer="step2ItemWriter" commit-interval="10" />
			</tasklet>
		</step>
		<step id="step4" next="completionDecider">
			<tasklet>
				<chunk reader="step3ItemReader" writer="step3ItemWriter" commit-interval="10" />
			</tasklet>
		</step>
		<decision decider="completionDecider" id="completionDecider">
			<next on="CONTINUE" to="step3"/>
			<end on="END"/>
		</decision>
	</job>
	
	<bean id="jobRepository" class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean"/>
	
	<bean id="jobExplorer" class="org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean">
		<property name="repositoryFactory" ref="&amp;jobRepository"/>
	</bean>
	
	<bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager"/>
	
	<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
		<property name="jobRepository" ref="jobRepository"/>
	</bean>
</beans>
