/** * Removes the job from the schedule if it exists. * * @param id */ public synchronized void removeScheduledJob(String id) { ScheduledJob job = scheduleIDMap.get(id); scheduleIDMap.remove(id); runner.removeScheduledJob(job); loader.saveSchedule(getSchedule()); }
/** * Give the schedule manager a loader class that will properly load the schedule. * * @param loader */ public ScheduleManager(JobExecutorManager executionManager, ScheduleLoader loader) { this.executionManager = executionManager; this.loader = loader; this.runner = new ScheduleRunner(); List<ScheduledJob> scheduleList = loader.loadSchedule(); for (ScheduledJob job : scheduleList) { internalSchedule(job); } this.runner.start(); }
/** Save the schedule */ private void saveSchedule() { loader.saveSchedule(getSchedule()); }