package com.stylefeng.guns.modular.system.util.task.base; import com.stylefeng.guns.core.util.SpringContextHolder; import com.stylefeng.guns.modular.system.service.ITDriverService; import com.stylefeng.guns.modular.system.service.ITNoticesService; import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; import com.stylefeng.guns.modular.system.service.ITUserService; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public abstract class AbstractJob implements Job{ protected Logger logger = LoggerFactory.getLogger(getClass()); @Override public abstract void execute(JobExecutionContext context) throws JobExecutionException; protected ITUserService tUserService; //用户 protected ITNoticesService tNoticesService; //公告 protected ITSystemNoticeService tSystemNoticeService; //公告记录 protected ITDriverService tDriverService; //司机 public AbstractJob(){ //this.exhibitionService = SpringContextsUtil.getBean("exhibitionService", IExhibitionService.class); this.tUserService = SpringContextHolder.getBean( ITUserService.class); this.tNoticesService = SpringContextHolder.getBean( ITNoticesService.class); this.tSystemNoticeService = SpringContextHolder.getBean( ITSystemNoticeService.class); this.tDriverService = SpringContextHolder.getBean( ITDriverService.class); } }