jobs.taskletJob.xml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-batch-samples
Show all versions of spring-batch-samples
Example batch jobs using Spring Batch Core and Execution.
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" 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/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <description> Deletes files in given directory - TaskletStep is used as this is the kind of task that is not natural to split into read and write. In this case the step is wrapped in a standalone job, however typically it would be a setup step in a multi-step job. The second step illustrates executing a system command. </description> <bean id="taskletJob" parent="simpleJob"> <property name="steps"> <list> <bean id="deleteFilesInDir" parent="taskletStep"> <property name="tasklet"> <bean class="org.springframework.batch.sample.tasklet.FileDeletingTasklet"> <property name="resources" value="file:target/test-outputs/test-dir/*" /> </bean> </property> </bean> <bean id="executeSystemCommand" parent="taskletStep"> <property name="tasklet"> <bean class="org.springframework.batch.core.step.tasklet.SystemCommandTasklet"> <property name="command" value="java -version" /> <!-- 5 second timeout for the command to complete --> <property name="timeout" value="5000" /> </bean> </property> </bean> </list> </property> </bean> </beans>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy