public void stop() {
    if (!checkState(State.RUNNING, State.INIT)) {
      __log.debug("stop() ignored -- already stopped");
      return;
    }

    __log.debug("BPEL SERVER STOPPING");

    _contexts.scheduler.stop();
    _state = State.INIT;
    __log.info(__msgs.msgServerStopped());
  }
  public void stop() {
    _mngmtLock.writeLock().lock();
    try {
      if (!checkState(State.RUNNING, State.INIT)) {
        __log.debug("stop() ignored -- already stopped");
        return;
      }

      __log.debug("BPEL SERVER STOPPING");

      if (processDefReaper != null) {
        processDefReaper.interrupt();
        processDefReaper = null;
      }
      _contexts.scheduler.stop();
      _engine = null;
      _state = State.INIT;
      __log.info(__msgs.msgServerStopped());
    } finally {
      _mngmtLock.writeLock().unlock();
    }
  }