protected void stopScheduler() {
    try {
      SchedulerFactory f = DefaultSchedulerFactory.getInstance();
      Scheduler s = f.getScheduler();
      s.stop(null, null);
    } catch (IOException ex) {
      // Log info:
      {
        String message = "Failure to stop scheduler!";
        log.log(Level.SEVERE, message, ex);
      }

      throw new RuntimeException(ex);
    } catch (Throwable ex) {
      // Log info:
      {
        String message = "Failure to stop scheduler!";
        log.log(Level.SEVERE, message, ex);
      }

      throw new RuntimeException(ex);
    }
  }