applicationContext.xml
配置文件如下:
配置文件如下:
<bean id="job" class="com.test.Job"></bean>
<!-- 定义目标bean和bean中的方法 -->
<bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref local="job"/>
</property>
<property name="targetMethod">
<value>update</value>
</property>
</bean>
<!-- 定义触发的时间 -->
<bean id = "cron" class = "org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="jobtask"/>
</property>
<property name="cronExpression">
<value>* * 16 * * ?</value>
</property>
</bean>
<!-- 总管理 -->
<bean autowire = "no" class = "org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local ="cron"/>
</list>
</property>
</bean>