1
石英調度程序中的pauseJob()和pauseTrigger()有什麼區別? 如何選擇其中之一供使用?現在我想暫停/ interept特定的工作,我該怎麼辦石英調度程序中的pauseJob和pauseTrigger之間的區別?
我的調度代碼給出波紋管
JobDetail job = new JobDetail();
job.setName("pollerjob"+pollerId);
job.setJobClass(Pollersheduller.class);
job.getJobDataMap().put("socialMediaObj", socialMediaObj);
job.getJobDataMap().put("queue", queue);
//configure the scheduler time
SimpleTrigger trigger = new SimpleTrigger();
trigger.setName("pollerSocial"+pollerId);
trigger.setStartTime(new Date(System.currentTimeMillis() + 1000));
trigger.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
trigger.setRepeatInterval(Long.parseLong(intervel));
//schedule it
Scheduler scheduler = null;
try {
scheduler = new StdSchedulerFactory().getScheduler();
scheduler.start();
scheduler.scheduleJob(job, trigger);
} catch (SchedulerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}