2
使用Java Quartz,我能夠安排一項工作。然後我嘗試了下面的代碼來添加其他工作。現在似乎都沒有在規定的時間觸發。我究竟做錯了什麼?石英工作未運行
我想要使用像下面的方法,而不是xml配置。
scheduler = StdSchedulerFactory.getDefaultScheduler();
JobDetail jobFull = new JobDetail("job1", "group1", IntegrationJobFull.class);
JobDetail jobPartial = new JobDetail("job2", "group1", IntegrationJobPartial.class);
CronTrigger triggerFull = new CronTrigger("trigger1", "group1", "job1", "group1", "0 15 3 * * ?");
CronTrigger triggerPartial = new CronTrigger("trigger2", "group1", "job2", "group1", "* 0,30 * * * ?");
scheduler.addJob(jobFull, false);
scheduler.addJob(jobPartial, false);
scheduler.scheduleJob(triggerFull);
scheduler.scheduleJob(triggerPartial);
scheduler.start();