pleaseStopFlag = true;
synchronized (this) { if (!stoppedFlag) { pleaseStopFlag = true; if (logger.isInfoEnabled()) { logger.info (this + " - stopping"); } notifyAll(); while (!stoppedFlag) { try { wait(); } catch (InterruptedException ie) { if (logger.isErrorEnabled()) { logger.error (this + " - stop interrupted", ie); } break; } } if (logger.isInfoEnabled()) { logger.info (this + " - stopped"); } } }
  public void pleaseStop () {    pleaseStopFlag = true;  }