Permalink
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (90 sloc) 5.36 KB
<?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:batch="http://www.springframework.org/schema/batch"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans classpath:org/springframework/beans/factory/xml/spring-beans-2.5.xsd
http://www.springframework.org/schema/batch classpath:packaged/xsd/spring-batch-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
http://www.springframework.org/schema/context classpath:org/springframework/context/config/spring-context-2.5.xsd">
<!-- This event producer bean is declared primarily for publishing Bootstrap lifecycle events -->
<bean id="platformEventProducer" class="org.trpr.platform.core.impl.event.PlatformEventProducerImpl">
</bean>
<!-- Create the MBeansExporter bean using the parent defined in common-spring-beans.xml.
Needed to export the "jobAdministrator" as a JMX MBean.
-->
<bean id="jobAdministratorExporter" parent="mbeansExporter">
<property name="beans">
<map>
<entry key="bean:name=jobAdministrator" value-ref="jobAdministrator"/>
<entry key="bean:name=batchMetricsExporter" value-ref="batchMetricsExporter"/>
</map>
</property>
</bean>
<!-- JMX interface bean for job administration.-->
<bean id="jobAdministrator" class="org.trpr.platform.batch.impl.spring.jmx.JobAdministrator">
<property name="jobExplorer" ref="jobExplorer"/>
<property name="jobOperator" ref="jobOperator"/>
<property name="jobService" ref="jobService"/>
</bean>
<!-- JMX interface bean for job metrics.-->
<bean id="batchMetricsExporter" class="org.trpr.platform.batch.impl.spring.jmx.BatchMetricsExporter">
<property name="server" ref="mbeanServer" />
<property name="jobAdministrator" ref="jobAdministrator"/>
</bean>
<!-- The JobService for that does most of the JMX metrics collection work -->
<bean id="jobService" class="org.trpr.platform.batch.impl.spring.admin.SimpleJobService">
<constructor-arg index="0"><ref bean="jobRepository"/></constructor-arg>
<constructor-arg index="1"><ref bean="jobExplorer"/></constructor-arg>
<constructor-arg index="2"><ref bean="jobRegistry"/></constructor-arg>
<constructor-arg index="3"><ref bean="asyncJobLauncher"/></constructor-arg>
<constructor-arg index="4"><ref bean="scheduleRepository"/></constructor-arg>
</bean>
<bean id="jobConfigService" class="org.trpr.platform.batch.impl.spring.admin.SimpleJobConfigurationService">
<constructor-arg index="0"><ref bean="jobRegistry"/></constructor-arg>
<constructor-arg index="1"><ref bean="jobService"/></constructor-arg>
</bean>
<!--
Configuring Common Batch Job TransactionManager.
-->
<bean id="transactionManager" class="org.springframework.batch.support.transaction.ResourcelessTransactionManager" />
<!-- Configuring Common Batch Job Repository. -->
<bean id="jobRepository" class="org.trpr.platform.batch.impl.spring.admin.repository.MapJobRepositoryFactoryBean">
<property name="transactionManager" ref="transactionManager" />
<property name="maxCount" value="2000" />
</bean>
<!-- Configuring Common Batch Job explorer -->
<bean id="jobExplorer" class="org.springframework.batch.core.explore.support.MapJobExplorerFactoryBean">
<!-- Inject the JobRepository's Factory bean instead of the bean itself as required by the JobExplorer's Factory bean -->
<property name="repositoryFactory" ref="&amp;jobRepository" />
</bean>
<!-- Configuring Common ScheduleRepository -->
<bean id ="scheduleRepository" class="org.trpr.platform.batch.impl.quartz.SimpleScheduleRepository" />
<!-- The common ChainingJobExecutionListener -->
<bean id ="chainingJobExecutionListener" class="org.trpr.platform.batch.impl.spring.job.ChainingJobExecutionListener">
<property name="jobAdministrator" ref="jobAdministrator"/>
</bean>
<!-- Configuring Common Batch Job Registry. -->
<bean id="jobRegistry" class="org.springframework.batch.core.configuration.support.MapJobRegistry" />
<!-- Configuring Common Sync .Batch Job Launcher. -->
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<!-- Configuring Common Async .Batch Job Launcher. -->
<bean id="asyncJobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
<property name="taskExecutor" ref="asyncJobExecutor" />
</bean>
<!-- Async Task executor used in all jobs -->
<bean id="asyncJobExecutor" class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
<!-- The Job operator bean for launching adhoc jobs -->
<bean id="jobOperator" class="org.springframework.batch.core.launch.support.SimpleJobOperator">
<property name="jobLauncher" ref="asyncJobLauncher"/>
<property name="jobExplorer" ref="jobExplorer"/>
<property name="jobRepository" ref="jobRepository"/>
<property name="jobRegistry" ref="jobRegistry"/>
</bean>
<!-- The incrementer to be used by all jobs -->
<bean id="incrementer" class="org.springframework.batch.core.launch.support.RunIdIncrementer" />
</beans>