2
我可以看到如何控制所有無狀態會話bean的全局池的大小。將池分配給JBoss EAP 6.1中的特定無狀態bean
但是,我希望能夠有一個新的池,只適用於一種無狀態bean。這樣,我所有的無狀態bean將從通常的slsb-strict-max-pool
中彙集,而一個bean將擁有自己的池。
在JBoss EAP 6.1中可以這樣做嗎?在EJB引用您的自定義池在standalone.xml定義
我可以看到如何控制所有無狀態會話bean的全局池的大小。將池分配給JBoss EAP 6.1中的特定無狀態bean
但是,我希望能夠有一個新的池,只適用於一種無狀態bean。這樣,我所有的無狀態bean將從通常的slsb-strict-max-pool
中彙集,而一個bean將擁有自己的池。
在JBoss EAP 6.1中可以這樣做嗎?在EJB引用您的自定義池在standalone.xml定義
使用
@org.jboss.ejb3.annotation.Pool(value="myPoolName")
註釋:
<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描述符)
<p:pool>
<ejb-name>myEjbName</ejb-name>
<p:bean-instance-pool-ref>myPoolName</p:bean-instance-pool-ref>
</p:pool>
有沒有辦法做到這一點,沒有通過XML配置的註釋? –
@purringpigeon查看編輯 – Gab
欣賞提示!謝謝。 –