从Container获取线程? [英] Getting thread from Container?
问题描述
在大多数应用程序服务器上,J2EE Ejb规范禁止手动创建线程,因为这些资源应由服务器管理。
On most of applications servers, J2EE Ejb specification forbids creating threads "by hand", since these resources should be managed by the server.
但是有没有办法从Tomcat,Glassfish,Jboss等获得线程。从而访问他们的ThreadPool?
But is there any way to get threads from Tomcat, Glassfish, Jboss etc.; thus access their ThreadPool?
推荐答案
你可以使用 commonj WorkManager 。这是IBM和BEA提出的一项提议,用于提供完成此任务的标准方法(访问容器管理的线程)。
You can use the commonj WorkManager. It was a proposal by IBM and BEA to provide a standard means to accomplish this task (access to container managed threads).
虽然它没有包含在实际规范中,但是大多数容器都有可用的实现。
Although it was not included in the actual specification, there are implementations available for most containers.
- Use in Weblogic
- Use in WebSphere
- Implementation for Tomcat, JBOSS and maybe others
- Spring integration
这篇关于从Container获取线程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!