Example #1
0
  /**
   * Release monitor resources and shut down the monitor.
   *
   * @throws InterruptedException
   */
  public synchronized void shutdown() throws InterruptedException {

    boolean changed = shutdown.compareAndSet(false, true);
    if (!changed) {
      return;
    }
    LoggerUtils.logMsg(logger, formatter, Level.INFO, "Shutting down monitor " + nameIdPair);
    if (learner != null) {
      learner.shutdown();
    }
    if (serviceDispatcher != null) {
      serviceDispatcher.shutdown();
    }
  }