<?xml version="1.0" encoding="UTF-8" ?>
- <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
- <!-- 指定要定时器执行的实例
-->
- <bean id="goodsDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
- <!-- 要执行的类对象
-->
<property name="targetObject" ref="goodsBiz" />
- <!-- 要执行的方法
-->
<property name="targetMethod" value="updateGoodsStatus" />
- <!-- 不同步执行
-->
<property name="concurrent" value="false" />
</bean>
- <!-- 每天23:30点执行
-->
- <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
- <!-- 运行实例对象
-->
<property name="jobDetail" ref="goodsDetail" />
- <!-- 规定时间
-->
<property name="cronExpression" value="0 30 23 * * ?" />
</bean>
- <!-- 定时器打包
-->
- <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
- <!-- 定时器集合
-->
- <property name="triggers">
- <list>
<ref bean="cronTrigger" />
</list>
</property>
</bean>
</beans>
- <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
- <!-- 指定要定时器执行的实例
-->
- <bean id="goodsDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
- <!-- 要执行的类对象
-->
<property name="targetObject" ref="goodsBiz" />
- <!-- 要执行的方法
-->
<property name="targetMethod" value="updateGoodsStatus" />
- <!-- 不同步执行
-->
<property name="concurrent" value="false" />
</bean>
- <!-- 每天23:30点执行
-->
- <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
- <!-- 运行实例对象
-->
<property name="jobDetail" ref="goodsDetail" />
- <!-- 规定时间
-->
<property name="cronExpression" value="0 30 23 * * ?" />
</bean>
- <!-- 定时器打包
-->
- <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
- <!-- 定时器集合
-->
- <property name="triggers">
- <list>
<ref bean="cronTrigger" />
</list>
</property>
</bean>
</beans>