applicationContext-quartz.xml
2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- <description>定时任务调度配置</description> -->
<bean id="jobInvokeBean" class="com.sibu.orderHelper.integralWeb.quart.ScheduleTask"></bean>
<bean id="generateRoomStock"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="jobInvokeBean"/>
<property name="targetMethod" value="generateRoomStock" />
<property name="concurrent" value="false" />
</bean>
<bean id="generateRoomStockCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="generateRoomStock" />
<property name="cronExpression" value="0 0/30 3-5 * * ?" />
</bean>
<!-- 定时发送入住前通知短信 -->
<bean id="sendCheckinNoticeMessage"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="jobInvokeBean"/>
<property name="targetMethod" value="sendCheckinHotelNoticeMessage" />
<property name="concurrent" value="false" />
</bean>
<bean id="sendCheckinNoticeMessageCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="sendCheckinNoticeMessage" />
<property name="cronExpression" value="0 0 8 * * ?" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="generateRoomStockCronTrigger" />
<ref bean="sendCheckinNoticeMessageCronTrigger" />
</list>
</property>
</bean>
</beans>