在JBoss EAP 6.1中将池分配给特定的无状态bean [英] Assign a pool to a specific stateless bean in JBoss EAP 6.1
问题描述
我可以看到如何控制所有无状态会话bean的全局池大小。
I can see how one can control the size of the global pool for all the stateless session beans.
但是,我希望能有一个新的仅适用于一种无状态bean的池。这样,我的所有无状态bean都将从通常的 slsb-strict-max-pool
中汇集,并且一个bean将拥有自己的池。
However, I would like to be able to have a new pool that only applies to one type of stateless bean. This way, all my stateless beans but one would be pooled from the usual slsb-strict-max-pool
, and one bean would have its own pool.
是否有可能在JBoss EAP 6.1中做到这一点?
Is it possible to do that in JBoss EAP 6.1?
推荐答案
使用
@org.jboss.ejb3.annotation.Pool(value="myPoolName")
在EJB上引用自定义池的注释,如standalone.xml中所定义:
annotation on the EJB referencing your custom pool as defined in the standalone.xml :
<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool"
max-pool-size="20" instance-acquisition-timeout="5"
instance-acquisition-timeout-unit="MINUTES" />
<strict-max-pool name="mdb-strict-max-pool"
max-pool-size="80" instance-acquisition-timeout="1"
instance-acquisition-timeout-unit="MINUTES" />
<strict-max-pool name="myPoolName"
max-pool-size="20" instance-acquisition-timeout="5"
instance-acquisition-timeout-unit="SECONDS" />
</bean-instance-pools>
</pools>
[编辑]:
在jboss-ejb3.xml中使用池命名空间(urn:ejb-pool:1.0)(特定于jboss的ejb描述符)
Using the pool namespace (urn:ejb-pool:1.0) in jboss-ejb3.xml (jboss specific ejb descriptor)
<p:pool>
<ejb-name>myEjbName</ejb-name>
<p:bean-instance-pool-ref>myPoolName</p:bean-instance-pool-ref>
</p:pool>
这篇关于在JBoss EAP 6.1中将池分配给特定的无状态bean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!