liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
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
<?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:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context-4.0.xsd
        http://www.springframework.org/schema/tx
        http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
 
 
    <!-- 要调用的工作类 
    <bean id="taskDemo" class="com.basic.x01.systemMenu.TaskDemo"></bean>
    
    <bean id="job_taskDemo"
        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject"><ref bean="taskDemo" /></property>
        <property name="targetMethod"><value>execute</value></property>
        <property name="concurrent"><value>false</value></property>
    </bean>
    
 
    <bean id="doTime_taskDemo" 
        class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail"><ref bean="job_taskDemo" /></property>
        <property name="cronExpression">
            <value>0/3 * * * * ?</value>
        </property>
    </bean>
 
    <bean id="taskDemo2" class="com.basic.x01.systemMenu.TaskDemo2"></bean>
    
    <bean id="job_taskDemo2"
        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject"><ref bean="taskDemo2" /></property>
        <property name="targetMethod"><value>execute</value></property>
        <property name="concurrent"><value>false</value></property>
    </bean>
 
    <bean id="doTime_taskDemo2" 
        class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail"><ref bean="job_taskDemo2" /></property>
        <property name="cronExpression">
            <value>0/3 * * * * ?</value>
        </property>
    </bean>
    -->
 
    <!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 
    <bean id="startQuertz" lazy-init="false" autowire="no"
        class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="doTime_taskDemo" />
                <ref bean="doTime_taskDemo2" />
            </list>
        </property>
    </bean>
    -->
    
</beans>