All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jobs.adhocLoopJob.xml Maven / Gradle / Ivy

There is a newer version: 1.1.4.RELEASE
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop"
	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">

	<!-- The tasklet used in this job will run in an infinite loop.  This is useful for testing graceful shutdown from
		multiple environments. -->

	<bean id="loopJob" parent="simpleJob">
		<property name="steps">
			<bean id="step1" parent="simpleStep">
				<property name="commitInterval" value="3" />
				<property name="itemReader">
					<bean class="org.springframework.batch.sample.common.InfiniteLoopReader" />
				</property>
				<property name="itemWriter">
					<bean
						class="org.springframework.batch.sample.common.InfiniteLoopWriter" />
				</property>
			</bean>
		</property>
		<property name="jobParametersIncrementer">
			<bean class="org.springframework.batch.sample.common.InfiniteLoopIncrementer"/>
		</property>
	</bean>

	<aop:config>
		<aop:aspect ref="eventAdvice">
			<aop:before
				pointcut="execution( * org.springframework.batch..Step+.execute(..)) and args(stepExecution)"
				method="before" />
			<aop:after
				pointcut="execution( * org.springframework.batch..Step+.execute(..)) and args(stepExecution)"
				method="after" />
			<aop:after-throwing throwing="t" 
				pointcut="execution( * org.springframework.batch..Step+.execute(..)) and args(stepExecution)"
				method="onError" />
		</aop:aspect>
	</aop:config>

</beans>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy