<?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">

	<import resource="simple-job-launcher-context.xml" />

	<bean class="org.springframework.jmx.export.MBeanExporter">
		<property name="beans">
			<map>
				<entry key="spring:service=batch,bean=jobLauncher">
					<bean
						class="org.springframework.batch.core.launch.support.SimpleExportedJobLauncher">
						<property name="launcher" ref="jobLauncher" />
						<property name="jobLocator"
							ref="jobConfigurationRegistry" />
					</bean>
				</entry>
				<entry
					key="spring:service=batch,bean=notificationPublisher"
					value-ref="notificationPublisher" />
				<entry
					key="spring:service=batch,bean=jobLoader"
					value-ref="loader" />
			</map>
		</property>
		<property name="assembler">
			<bean
				class="org.springframework.jmx.export.assembler.InterfaceBasedMBeanInfoAssembler">
				<property name="interfaceMappings">
					<map>
						<entry
							key="spring:service=batch,bean=jobLauncher"
							value="org.springframework.batch.core.launch.support.ExportedJobLauncher" />
						<entry key="spring:service=batch,bean=jobLoader"
							value="org.springframework.batch.sample.JobLoader" />
					</map>
				</property>
			</bean>
		</property>
	</bean>

	<bean id="notificationPublisher"
		class="org.springframework.batch.sample.advice.JobExecutionNotificationPublisher" />

	<bean id="jobLauncher"
		class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
		<property name="jobRepository" ref="jobRepository" />
		<property name="taskExecutor">
			<bean
				class="org.springframework.core.task.SimpleAsyncTaskExecutor" />
		</property>
	</bean>

	<bean id="loader"
		class="org.springframework.batch.sample.DefaultJobLoader">
		<property name="registry" ref="jobConfigurationRegistry" />
	</bean>

</beans>
