Spring集成Quartz定时器

<!-- Spring集成Quartz开始 -->

    <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref bean="doTime"/>
            </list>
        </property>
    </bean>

    <bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="jobtask"/>
        </property>
        <property name="cronExpression">
            <value>0 22 17 * * ?</value>
        </property>
    </bean>
    <bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject">
            <ref bean="quartzJob"/>
        </property>
        <property name="targetMethod">
            <value>TimerSync</value><!--调用方法-->
        </property>
    </bean>
    <bean id="quartzJob" class="com.TaskAction"></bean><!--调用action-->
    
    <!-- Spring集成Quartz结束 -->

 

posted @ 2015-07-13 11:08  雪卜  阅读(194)  评论(0编辑  收藏  举报