Pages

2014년 2월 18일 화요일

[SPRING] Spring mvc에서 Quartz 적용하기 - (9)

01<?xml version="1.0" encoding="UTF-8"?>
02<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
04<beans>
05    <import resource="data-source-context.xml" />
06    <import resource="post-man-context.xml" />
07     
08    <bean id="postManJob"
09        class="kr.kangwoo.postman.core.PostManJob">
10        <property name="mailManager" ref="mailManager" />
11        <property name="mailTemplateManager" ref="mailTemplateManager" />
12        <property name="mailSendManager" ref="mailSendManager" />
13    </bean>
14     
15    <bean id="jobDetail"
16        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
17        <property name="targetObject" ref="postManJob" />
18        <property name="targetMethod" value="run" />
19        <property name="concurrent" value="false" />
20    </bean>
21     
22    <bean id="scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
23        <property name="triggers">
24            <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
25                <property name="jobDetail" ref="jobDetail" />
26                <property name="cronExpression" value="0/30 * * * * ?" />
27            </bean>
28        </property>
29    </bean>
30</beans>

- postman.properties (설정 정보)
01#Database
02batch.jdbc.driver=oracle.jdbc.driver.OracleDriver
03batch.jdbc.url=jdbc:oracle:thin:@xxx.kangwoo.kr:1521:XE
04batch.jdbc.user=USER
05batch.jdbc.password=PWD
06 
07#SMTP
08smtp.host=smtp.gmail.com
09smtp.port=587
10smtp.starttlsEnable=true
11smtp.userName=xxx@mail.com
12smtp.password=pwd

댓글 없음:

댓글 쓰기