code: public void exit() {
          if (exiting()) {
              logger.debug("Another thread is shutting down");
              return;
          }
          final long start = System.currentTimeMillis();
          //noinspection finally
          File exitingSignal = getSignal("exiting");
          try {
              logger.info(banner("Unloading the main component {}", this.mainComponent));
              FileUtils.touch(exitingSignal);
              environment.unload(this.mainComponent);
              logger.info(banner("Unloaded  the main component {}", this.mainComponent));
          } catch (Exception ex) {
              logger.error(ex.getMessage(), ex);
          } finally {
              FileUtils.deleteQuietly(exitingSignal);
              //启动一个额外的线程停止自身
              new Thread("Stopper") {
                  @Override
                  public void run() {
                      logger.info(banner("System stops took {}", formatDurationHMS(System.currentTimeMillis() - start)));
                      System.exit(0);
                  }
              }.start();
          }
      }
docs: 退出