code: public void shutdown(ShutdownModeAmp mode,
                         ExitCode exitCode, 
                         String msg,
                         Result<String> result)
    {
      startFailSafeShutdown(msg);
  
      ShutdownThread shutdownThread = _shutdownThread;
      
      if (shutdownThread != null) {
        shutdownThread.startShutdown(mode, exitCode, result);
  
        if (! _isEmbedded) {
          waitForShutdown();
        
          System.out.println("Shutdown timeout");
          System.exit(exitCode.ordinal());
        }
      }
      else {
        shutdownImpl(mode, exitCode, result);
      }
    }
docs: Start the server shutdown