<? 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.xsd" >
<bean id ="taskJob" class ="com.zfl.common.task.AttendCheckTask" />
<bean id ="jobDetail" class ="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" >
<property name ="targetObject" ref ="taskJob" />
<property name ="targetMethod" value ="checkAttend" />
</bean>
<bean id ="attendCheck" class ="org.springframework.scheduling.quartz.CronTriggerFactoryBean" >
<property name ="jobDetail" ref ="jobDetail" />
<property name ="cronExpression" >
<value> 0/30 * * * * ?</value>
</property>
</bean>
<bean id ="scheduler" class ="org.springframework.scheduling.quartz.SchedulerFactoryBean" >
<property name ="triggers" >
<list>
<ref bean ="attendCheck" />
</list>
</property>
</bean>
</beans>
导入spring配置+包依赖
在线生成cron.qqez.com