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);
    }
  }
  protected void stopTerminal() {
    try {
      TerminalFactory f = DefaultTerminalFactory.getInstance();
      Terminal t = f.getTerminal();
      t.stop();
    } catch (IOException ex) {
      // Log info:
      {
        String message = "Failure to stop terminal!";
        log.log(Level.SEVERE, message, ex);
      }

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

      throw new RuntimeException(ex);
    }
  }
  public static void shutdownThreadPoolsNow() {
    try {
      ThreadPoolManager.shutdownAllNow();
    } catch (Throwable ex) {
      // Log info:
      {
        Level level = Level.SEVERE;
        Logger logger = log;
        if (logger.isLoggable(level)) {
          String message = "Failure to stop thread pools!";
          logger.log(level, message, ex);
        }
      }

      throw new RuntimeException(ex);
    }
  }
  protected void statFlush() {
    try {
      DSLDataAccessorFactory f = DefaultDSLDataAccessorFactory.getInstance();
      DSLDataAccessor a = f.getDSLDataAccessor();

      a.statFlush();
    } catch (Throwable ex) {
      // Log info:
      {
        Level level = Level.SEVERE;
        Logger logger = log;
        if (logger.isLoggable(level)) {
          String message = "Failure to flush statistical info!";
          logger.log(level, message, ex);
        }
      }
    }
  }