code: private void stop(ShutdownModeAmp mode)
    {
      _shutdownMode = mode;
      
      Thread thread = Thread.currentThread();
      ClassLoader oldLoader = thread.getContextClassLoader();
  
      try {
        thread.setContextClassLoader(_classLoader);
  
        if (! _lifecycle.toStopping()) {
          return;
        }
  
        TreeSet<SubSystem> systems
          = new TreeSet<SubSystem>(new StopComparator());
  
        systems.addAll(_systemMap.values());
  
        // sort
  
        for (SubSystem system : systems) {
          try {
            thread.setContextClassLoader(_classLoader);
  
            if (log.isLoggable(Level.FINEST)) {
              log.finest(system + " stopping");
            }
  
            system.stop(mode);
          } catch (Throwable e) {
            log.log(Level.WARNING, e.toString(), e);
          }
        }
  
      } finally {
        _lifecycle.toStop();
  
        thread.setContextClassLoader(oldLoader);
      }
    }
docs: stops the server.