Are java app servers able to destroy threads? If yes, how?

前端 未结 2 1410
独厮守ぢ
独厮守ぢ 2020-12-18 03:31

Destroying threads is deprecated in Java (and not implemented according to javadoc), and interrupting it is only a suggestion which upon the thread is expected to quit, but

2条回答
  •  没有蜡笔的小新
    2020-12-18 04:09

    You're not allowed to create a thread of your own inside an ejb server.

    It's not that uncommon to spawn threads in a web container(such as e.g. tomcat) , though you should really think carefully about doing that - and be sure to manage the lifecycle of those threads.

提交回复
热议问题