简体   繁体   English

如何管理在网络服务器上运行的 Java 线程?

[英]How to manage java threads running on webserver?

I'm running a web application that runs a java code, the java code add it's own threads.我正在运行一个运行 java 代码的 web 应用程序,java 代码添加了它自己的线程。 What is the recommended way to manage those threads.管理这些线程的推荐方法是什么。 Right now the thread are not managed and when the webapp stopped running on the webserver the java thread continues in the backround现在线程不受管理,当 webapp 停止在 web 服务器上运行时,java 线程继续在后台运行

使用ServletContextListener并在上下文被破坏时停止后台任务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM