docs: protected void shutDown() {
  
          synchronized (LOCK) {
              if (getRunLevel() > OpenCms.RUNLEVEL_0_OFFLINE) {
                  System.err.println(
                      Messages.get().getBundle().key(
                          Messages.LOG_SHUTDOWN_CONSOLE_NOTE_2,
                          getSystemInfo().getVersionNumber(),
                          getSystemInfo().getWebApplicationName()));
                  if (CmsLog.INIT.isInfoEnabled()) {
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_DOT_0));
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_DOT_0));
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_LINE_0));
                      CmsLog.INIT.info(
                          Messages.get().getBundle().key(
                              Messages.INIT_SHUTDOWN_START_1,
                              getSystemInfo().getVersionNumber() + " [" + getSystemInfo().getVersionId() + "]"));
                      CmsLog.INIT.info(
                          Messages.get().getBundle().key(Messages.INIT_CURRENT_RUNLEVEL_1, new Integer(getRunLevel())));
                      CmsLog.INIT.info(
                          Messages.get().getBundle().key(
                              Messages.INIT_SHUTDOWN_TIME_1,
                              new Date(System.currentTimeMillis())));
                  }
  
                  // take the system offline
                  setRunLevel(OpenCms.RUNLEVEL_0_OFFLINE);
  
                  if (LOG.isDebugEnabled()) {
                      // log exception to see which method did call the shutdown
                      LOG.debug(Messages.get().getBundle().key(Messages.LOG_SHUTDOWN_TRACE_0), new Exception());
                  }
  
                  try {
                      // the first thing we have to do is to wait until the current publish process finishes
                      if (null != m_publishEngine) {
                          m_publishEngine.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_PUBLISH_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      // search manager must be shut down early since there may be background indexing still ongoing
                      if (m_searchManager != null) {
                          m_searchManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_SEARCH_MANAGER_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      // remote shell server must be shut down early since there is a background thread ongoing that reloads from the VFS
                      if (m_remoteShellServer != null) {
                          m_remoteShellServer.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_REMOTESHELL_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      // VFS bundle manager must be shut down early since there is a background thread ongoing that reloads from the VFS
                      if (m_vfsBundleManager != null) {
                          m_vfsBundleManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_VFSBUNDLE_MANAGER_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_staticExportManager != null) {
                          m_staticExportManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_EXPORT_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_moduleManager != null) {
                          m_moduleManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_MODULE_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
  
                  try {
                      if (m_executor != null) {
                          m_executor.shutdownNow();
                          m_executor.awaitTermination(30, TimeUnit.SECONDS);
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_MODULE_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
  
                  try {
                      if (m_scheduleManager != null) {
                          m_scheduleManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_SCHEDULE_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_resourceManager != null) {
                          m_resourceManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_RESOURCE_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
  
                  try {
                      if (m_repositoryManager != null) {
                          m_repositoryManager.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(e.getLocalizedMessage(), e);
                  }
  
                  try {
                      // has to be stopped before the security manager, since this thread uses it
                      if (m_threadStore != null) {
                          m_threadStore.shutDown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_THREAD_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_securityManager != null) {
                          m_securityManager.destroy();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_SECURITY_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_sessionManager != null) {
                          m_sessionManager.shutdown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_SESSION_MANAGER_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_memoryMonitor != null) {
                          m_memoryMonitor.shutdown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_MEMORY_MONITOR_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
                  try {
                      if (m_adeManager != null) {
                          m_adeManager.shutdown();
                      }
                  } catch (Throwable e) {
                      CmsLog.INIT.error(
                          Messages.get().getBundle().key(Messages.LOG_ERROR_ADE_MANAGER_SHUTDOWN_1, e.getMessage()),
                          e);
                  }
  
                  String runtime = CmsStringUtil.formatRuntime(getSystemInfo().getRuntime());
                  if (CmsLog.INIT.isInfoEnabled()) {
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_OPENCMS_STOPPED_1, runtime));
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_LINE_0));
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_DOT_0));
                      CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_DOT_0));
                  }
                  System.err.println(Messages.get().getBundle().key(Messages.LOG_CONSOLE_TOTAL_RUNTIME_1, runtime));
  
              }
              m_instance = null;
          }
      }