applicationContext-quartz.xml
3.17 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?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:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd">
<!-- see java based configuration file -->
<task:annotation-driven/>
<context:annotation-config/>
<bean class="org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor"/>
<!-- 配置调度程序quartz
<bean id="indexRebuildJob" class="IndexRebuildJob" />
<bean id="indexRebuildJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="indexRebuildJob" />
</property>
<property name="targetMethod">
<value>execute</value>
</property>
</bean>
<bean id="indexRebuildJobCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="indexRebuildJobDetail"></property>
<property name="cronExpression" value="0 0 3 * * ?"></property>
</bean>
-->
<!-- ======================== 调度触发器 ========================
<bean id="rebuildTblProductIndexJobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="indexRebuildJob" />
</property>
<property name="targetMethod">
<value>rebuildTblProductIndex</value>
</property>
</bean>
<bean id="rebuildTblProductIndexCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="rebuildTblProductIndexJobDetail"></property>
<property name="cronExpression" value="0 50 * * * ?"></property>
</bean>
<bean id="tplAdaptorJob" class="TplAdaptorJob" />
<bean id="tplAdaptorJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="tplAdaptorJob" />
</property>
<property name="targetMethod">
<value>doTplAdaptor</value>
</property>
</bean>
<bean id="tplAdaptorJobCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="tplAdaptorJobDetail"></property>
<property name="cronExpression" value="0 55 * * * ?"></property>
</bean>
-->
<!-- ======================== 调度工厂 ========================
<bean id="SpringJobSchedulerFactoryBean"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="indexRebuildJobCronTrigger" />
<ref bean="rebuildTblProductIndexCronTrigger" />
<ref bean="tplAdaptorJobCronTrigger" />
</list>
</property>
</bean>
-->
</beans>