<?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:p="
http://www.springframework.org/schema/p"
xmlns:aop="
http://www.springframework.org/schema/aop"
xmlns:tx="
http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/batch
http://www.springframework.org/schema/batch/spring-batch-2.0.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
<import resource="classpath*:ams/rf/beans-definitions.xml" />
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:database.properties</value>
</list>
</property>
</bean>
<!-- the transactional advice (i.e. what 'happens'; see the
<aop:advisor/> bean below) -->
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<!-- the transactional semantics... -->
<tx:attributes>
<!-- all methods starting with 'get' are read-only -->
<tx:method name="get*" read-only="true"
propagation="REQUIRED" rollback-for="AbstractRgpException" />
<!-- other methods use the default transaction settings (see below)
-->
<tx:method name="*" propagation="REQUIRED" />
<!-- <tx:method name="*" propagation="REQUIRED" rollback-
for="AbstractRgpException"/>-->
</tx:attributes>
</tx:advice>
<!-- ensure that the above transactional advice runs for any
execution
of an operation defined by the FooService interface -->
<aop:config>
<aop:pointcut id="TxAdvicePointCut"
expression="execution(* fr.rgp.rf..*(..))" />
<aop:advisor advice-ref="txAdvice"
pointcut-ref="TxAdvicePointCut" />
</aop:config>
<bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean">
<property name="transactionManager" ref="transactionManager" />
</bean>
<!--
<job id="job" restartable="false"
xmlns="
http://www.springframework.org/schema/batch">
</job>-->
<job id="hibernateJob" restartable="false"
xmlns="
http://www.springframework.org/schema/batch">
<step id="step1">
<tasklet>
<listeners>
<listener ref="logStepListener"></listener>
<listener ref="logChunkListener"></listener>
<listener ref="logReaderListener"></listener>
<listener ref="logProcessListener"></listener>
<listener ref="logWriterListener"></listener>
</listeners>
<chunk reader="hibernateAutomatePollePlusReader"
processor="automatePollePlusProcessor" writer="hibernateWriter"
commit-interval="3">
</chunk>
</tasklet>
<next on="*" to="step2" />
<fail on="FAILED" exit-code="FAILED" />
</step>
[...]
</job>
[...]
<!-- Listener pour connaître les temps de traitement sur chaque step
-->
<bean id="logStepListener"
class="fr.rgp.listener.LogStepExecutionListener">
</bean>
<!-- Listener sur reader -->
<bean id="logReaderListener"
class="fr.rgp.listener.LogReaderListener">
</bean>
<!-- Listener sur process -->
<bean id="logProcessListener"
class="fr.rgp.listener.LogProcessListener">
</bean>
<!-- Listener sur writer -->
<bean id="logWriterListener"
class="fr.rgp.listener.LogWriterListener">
</bean>
<!-- Listener chunk (peut-être pas utile) -->
<bean id="logChunkListener"
class="fr.rgp.listener.LogChunkListener">
</bean>
</beans>