Exemplo n.º 1
0
  /**
   * 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());
  }
Exemplo n.º 2
0
  /**
   * 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();
  }
Exemplo n.º 3
0
 /** Save the schedule */
 private void saveSchedule() {
   loader.saveSchedule(getSchedule());
 }