OPEN - issue BATCH-404: FactoryBeans for step configuration

http://jira.springframework.org/browse/BATCH-404

New flag on DefaultStepFactoryBean for item skip policy (alwaysSkip=false is the default).
This commit is contained in:
dsyer
2008-03-02 12:04:12 +00:00
parent df0c615ff8
commit 108c21b187
4 changed files with 60 additions and 43 deletions

View File

@@ -15,31 +15,17 @@
<!-- set restartable=false so that this job can be used by more than one test -->
<property name="restartable" value="false" />
<property name="steps">
<bean id="step1" parent="defaultStep"
class="org.springframework.batch.execution.step.support.KitchenSinkStepFactoryBean">
<property name="itemReader" ref="hibernateItemReader" />
<property name="itemWriter" ref="hibernateOutputSource" />
<property name="commitInterval" value="3" />
<property name="exceptionHandler">
<bean
class="org.springframework.batch.repeat.exception.handler.SimpleLimitExceptionHandler">
<property name="limit" value="5" />
<property name="useParent" value="true" />
</bean>
</property>
<property name="itemSkipPolicy">
<bean
class="org.springframework.batch.execution.step.support.AlwaysSkipItemSkipPolicy" />
</property>
</bean>
</property>
</bean>
<!-- This is a framework class that needs a delegate and also needs to be registered as a RepeatInterceptor in the chunk -->
<bean id="step1" parent="defaultStep">
<property name="alwaysSkip" value="true" />
<property name="itemReader" ref="hibernateItemReader" />
<property name="itemWriter" ref="hibernateOutputSource" />
<property name="commitInterval" value="3" />
</bean>
</property>
</bean>
<!-- This is a framework class that needs a delegate and also needs to be registered as a RepeatInterceptor in the chunk -->
<bean id="hibernateOutputSource"
class="org.springframework.batch.io.support.HibernateAwareItemWriter">
<property name="sessionFactory" ref="sessionFactory" />

View File

@@ -14,15 +14,10 @@
<bean id="tradeJob" parent="simpleJob">
<property name="steps">
<list>
<bean id="step1" parent="simpleStep"
class="org.springframework.batch.execution.step.support.KitchenSinkStepFactoryBean">
<property name="exceptionHandler">
<bean
class="org.springframework.batch.repeat.exception.handler.SimpleLimitExceptionHandler"
p:limit="5" />
</property>
<property name="listeners" ref="fileInputTemplate" />
<property name="itemReader">
<bean id="step1" parent="defaultStep">
<property name="alwaysSkip" value="true" />
<property name="listeners" ref="fileInputTemplate" />
<property name="itemReader">
<bean
class="org.springframework.batch.item.reader.ValidatingItemReader">
<property name="itemReader"