Java Reference
In-Depth Information
<beans:bean id="customerIdItemProcessor"
class="com.apress.springbatch.chapter8.CustomerItemProcessor">
<beans:property name="customerDao" ref="customerDao"/>
</beans:bean>
<beans:bean id="accountExecutiveItemProcessor"
class="com.apress.springbatch.chapter8.AccountExecutiveItemProcessor">
<beans:property name="accountExecutiveDao" ref="accountExecutiveDao"/>
</beans:bean>
<beans:bean id="completeItemProcessor"
class="org.springframework.batch.item.support.CompositeItemProcessor">
<beans:property name="delegates">
<util:list>
<beans:ref bean="customerIdItemProcessor"/>
<beans:ref bean="accountExecutiveItemProcessor"/>
</util:list>
</beans:property>
</beans:bean>
<step id="copyFileStep">
<tasklet>
<chunk reader="customerFileReader" processor="completeItemProcessor"
writer="outputWriter"
commit-interval="10"/>
</tasklet>
</step>
<job id="copyJob">
<step id="step1" parent="copyFileStep"/>
</job>
</beans:beans>
There is a lot of XML here, so let's start at the top. Beginning with the normal Spring configuration
file imports and the inclusion of your normal launch-context.xml file, this file contains 10 uniquely
configured beans (not including nested beans of the actual step or job). Table 8-1 walks through each of
the beans configured in this file.
Table 8-1. Beans Configured for the CompositeItemProcessor Example
Bean
Description
Dependencies
customerFile
The input file to be read
(the actual file name will
be passed in as a
parameter of the job).
None
customerFileReader
The FlatFileItemReader
used for the step in this
job.
customerFile (the file to be read by
this reader)
 
 
Search WWH ::




Custom Search