捕获(tomcat / spring)webapp停止/关闭事件

时间:2018-12-03 10:59:40

标签: java spring event-handling application-shutdown tomcat8.5

我在tomcat 8.5中使用spring(integration)webapp。 在关闭/停止过程开始之前,我需要捕捉有关停止/关闭的任何事件(将会注意到的一些问题:Web应用程序将停止)。

为什么? 我需要创建并发送有关该应用程序将停止的syslog条目,我想使用spring集成环境来完成工作。因此,我需要事件才能在tomcat / spring环境中发生所有事情。

我从tomcat看了ServletContextListener,但是在所有servlet被销毁后运行了它,并且从spring事件中查看了ContextStoppedEvent,但是不清楚谁将调用stop(),在这种情况下上下文已经停止了。

感谢

0 个答案:

没有答案