<bean id="quartzJob" class="com.wq.ta.da.reoortriskrule.listener.quartzJob" />
<!-- 调度业务 -->
<bean id="jobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="quartzJob" />
<property name="targetMethod" value="service" />
</bean>
<!-- 增加调用的触发器,触发时间 -->
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail" ref="jobDetail" />
<property name="cronExpression" value="0/1 * * * * ? *" />
</bean>
package com.esafenet.ta.da.reoortriskrule.listener;
public class quartzJob {
public void service(){
System.out.println("我是任务5s执行一次");
}
}