在大多数应用程序服务器上,J2EE Ejb 规范禁止“手动”创建线程,因为这些资源应由服务器管理。
但是有没有办法从 Tomcat、Glassfish、Jboss 等获取线程?从而访问他们的ThreadPool?
您可以使用通用工作管理器 http://download.oracle.com/docs/cd/E11035_01/wls100/commonj/commonj.html#wp1057962。 IBM 和 BEA 提议提供一种标准方法来完成此任务(访问容器管理的线程)。
尽管它没有包含在实际规范中,但大多数容器都有可用的实现。
- 在Weblogic中使用 http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_wls/self_tuned.html
- 在WebSphere 中使用 http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.express.doc/info/exp/asyncbns/concepts/casb_workmgr.html
- Tomcat、JBOSS 等的实现 http://commonj.myfoo.de/
- 弹簧集成 http://static.springsource.org/spring/docs/3.1.0.M2/spring-framework-reference/html/scheduling.html#scheduling-task-executor-types
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)