public void shutdown(ShutdownModeAmp mode){
  stop(mode);
  if (!_lifecycle.toDestroy()) {
    return;
  }
  Thread thread=Thread.currentThread();
  ClassLoader oldLoader=thread.getContextClassLoader();
  try {
    thread.setContextClassLoader(_classLoader);
    TreeSet<SubSystem> systems=new TreeSet<SubSystem>(new StopComparator());
    systems.addAll(_systemMap.values());
    _systemMap.clear();
    for (    SubSystem system : systems) {
      try {
        system.destroy();
      }
 catch (      Throwable e) {
        log.log(Level.WARNING,e.toString(),e);
      }
    }
    WeakReference<SystemManager> globalRef=_globalSystemRef;
    if (globalRef != null && globalRef.get() == this) {
      _globalSystemRef=null;
    }
    log.fine(this + " destroyed");
    _classLoader.destroy();
  }
  finally {
    thread.setContextClassLoader(oldLoader);
    _classLoader=null;
  }
}

public void shutdown ( ShutdownModeAmp mode ) { stop ( mode ) ; if ( ! _lifecycle . toDestroy ( ) ) { return ; } Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( _classLoader ) ; TreeSet < SubSystem > systems = new TreeSet < SubSystem > ( new StopComparator ( ) ) ; systems . addAll ( _systemMap . values ( ) ) ; _systemMap . clear ( ) ; for ( SubSystem system : systems ) { try { system . destroy ( ) ; } catch ( Throwable e ) { log . log ( Level . WARNING , e . toString ( ) , e ) ; } } WeakReference < SystemManager > globalRef = _globalSystemRef ; if ( globalRef != null && globalRef . get ( ) == this ) { _globalSystemRef = null ; } log . fine ( this + " destroyed" ) ; _classLoader . destroy ( ) ; } finally { thread . setContextClassLoader ( oldLoader ) ; _classLoader = null ; } }
shuts down the server in the given mode .
