Runtime.getRuntime().addShutdownHook(new Thread()

 //addShutdownHook是指,增加JVM停止时要做处理事件。当JVM停止时,就会把之前增加的这些HOOK逐个运行。

 Runtime.getRuntime().addShutdownHook(new Thread() {
        public void run() {
         logger.info("==> zoiesystem shutdown ...");
        _zoiesystem.shutdown();
        logger.info("==> zoiesystem shutdown success.");
        }
   });