config.properties文件配置如下
cron.com.fzzl.test.XtUserOnlineJob=0 0/1 * * * ?
cron.pkgs=com.fzzl.test
MainSetup.java代码如下
// 启动JOB
try {
ioc.get(NutQuartzCronJobFactory.class);
} catch (Exception e) {
log.error(e);
}
测试类如下:
@IocBean
public class XtUserOnlineJob implements Job{
@Inject protected Dao dao;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
System.out.println("_________________________________");
System.out.println("______________定_________________");
System.out.println("______________时_________________");
System.out.println("______________器_________________");
System.out.println("______________OK_________________");
System.out.println("______________!_________________");
System.out.println("_________________________________");
}
}
但是还是没有启动定时任务,是我忽略了哪些配置吗?