示例#1
0
  public static void contextDestroyed(ServletContextEvent sce) {
    UserLoginListener.forceAllUserOffline();

    if (runingMonitor) {
      log.info("记录服务器关闭日志");
      log.info("Recording the server shutdown logging", Locale.ENGLISH);
      runingTime.setShutdownTime(new Date());
      runingTime.setRuningTime(
          runingTime.getShutdownTime().getTime() - runingTime.getStartupTime().getTime());
      LogQueue.addLog(runingTime);
    }
    if (memoryMonitor) {
      log.info("停止内存监视线程");
      log.info("Stop memory monitor thread", Locale.ENGLISH);
      memoryMonitorThread.running = false;
      memoryMonitorThread.interrupt();
    }

    if (LogQueue.getLogQueue() != null) {
      LogQueue.getLogQueue().saveLog();
    }
    deregisterDrivers();
    log.info("卸载JDBC驱动");
    log.info("Uninstalled JDBC driver", Locale.ENGLISH);
  }