<!--声明要定时跑的类-->
<bean id="syncYXBiz" class="com.sf.ddt.task.biz.SyncYXBiz"/>
<!--具体的哪个方法-->
<bean id="syncOrderDataTask"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref bean="syncYXBiz" />
</property>
<property name="targetMethod">
<value>syncOrderData</value>
</property>
<property name="concurrent">
<value>false</value>
</property>
</bean>
<!--调用频次-->
<bean id="syncOrderJob"class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="syncOrderDataTask" />
</property>
<property name="cronExpression">
<!-- <value>0 30 1 ? * *</value> -->
<value>0/10 * * * * ?</value>
</property>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<!--这里可以添加多个定时任务-->
<ref bean="syncOrderJob" />
</list>
</property>
</bean>
把以上配置信息粘贴到spring配置文件里,修改下自己需要的类就可以跑起来定时任务了。