<?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>MyHello Job</description>
	
	<bean id="jobLauncher"
		class="org.springframework.batch.core.launch.support.SimpleJobLauncher"
		p:jobRepository-ref="jobRepository" />
	
	<bean id="jobRepository"
		class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
		p:databaseType="mysql" 
		p:dataSource-ref="dataSource"
		p:transactionManager-ref="transactionManager" />
		
	<bean id="simpleJob" 
		class="org.springframework.batch.core.job.SimpleJob" 
		abstract="true"
		p:jobRepository-ref="jobRepository"
		p:restartable="true" />

	<bean id="taskletStep" 
		class="org.springframework.batch.core.step.tasklet.TaskletStep" 
		abstract="true"
		p:jobRepository-ref="jobRepository" />
		
		

	<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url" value="jdbc:mysql://localhost:3306/timemachine" />
		<property name="username" value="root" />
		<property name="password" value="c12345" />
	</bean>
	<bean id="transactionManager"
		class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
		lazy-init="true"
		p:dataSource-ref="dataSource" />
	
	
	
		
	<bean id="myHelloJob" parent="simpleJob">
		<property name="name" value="myHelloJob" />
		<property name="steps">
			<list>
				<bean id="firstHello" parent="taskletStep">
					<property name="tasklet">
						<bean class="com.naver.news.library.job.MyHello">
							<property name="message" value="Hi~" />
						</bean>
					</property>
				</bean>
				<bean id="secondHello" parent="taskletStep">
					<property name="tasklet">
						<bean class="com.naver.news.library.job.MyHello">
							<property name="message" value="Oh~ Hi~" />
						</bean>
					</property>
				</bean>
			</list>
		</property>
	</bean>
</beans>

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 13-Dec-2008 15:11 by DongGukLee