Job实现类代码
1 package cn.itcast.quartz; 2 3 import org.quartz.Job; 4 import org.quartz.JobExecutionContext; 5 import org.quartz.JobExecutionException; 6 import org.springframework.beans.factory.annotation.Autowired; 7 import org.springframework.stereotype.Service; 8 9 import cn.itcast.service.HelloServiceImpl; 10 11 /** 12 * @author: 攻城狮小白 13 * @creationTime:2017年11月20日 下午5:21:28 14 */ 15 @Service 16 public class HelloJob implements Job{ 17 18 @Autowired 19 private HelloServiceImpl helloServiceImpl; 20 public void execute(JobExecutionContext context) throws JobExecutionException { 21 helloServiceImpl.sayHello(); 22 } 23 24 }