首页 文章

如何使用管理控制台和Jboss的CLI工具为会话和消息驱动Bean配置Bean池

提问于
浏览
-1

我找到了为Jboss版本EAP 6.0创建和编辑bean池配置的解决方案

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.1/html/Administration_and_Configuration_Guide/Create_a_Bean_Pool1.html

https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6/html/Administration_and_Configuration_Guide/Edit_a_Bean_Pool1.html

Worker MDB:

@MessageDriven(activationConfig = { @ActivationConfigProperty(prop ertyName="destinationType" , propertyValue="javax.jms.Queue"), @ActivationConfigProperty(propertyName="destination" , propertyValue="queue/replenish") @ActivationConfigProperty(prop ertyName=”minSessions” , propertyValue=”25”) @ActivationConfigProperty(prop ertyName=”maxSessions” , propertyValue=”50”) })

对于Jboss EAP 7.0和Jboss AS 6.1.0.Final,我需要相同的解决方案吗? [如何使用管理控制台和CLI工具为Jboss EAP 7.0和Jboss AS 6.1.0.Final创建或编辑bean池,“创建Bean池”和“编辑Bean池”? slsb-strict-max-pool mdb-strict-max-pool]

1 回答

  • 0

    我找到了这个解决方案,但@pool是基于Jboss特定的注释

    import org.jboss.ejb3.annotation.Pool;
    import org.jboss.ejb3.annotation.defaults.PoolDefaults;
    @Stateless
    @Pool (value=PoolDefaults.POOL_IMPLEMENTATION_STRICTMAX,maxSize=5,timeout=1000)
    @Remote(StrictlyPooledSession.class)
    public class StrictlyPooledSessionBean implements StrictlyPooledSession
    {
    ...
    }
    
    
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <aop xmlns="urn:jboss:aop-beans:1.0">
    
       <domain name="Strictly Pooled Stateless Bean" extends="Stateless Bean" inheritBindings="true">
          <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
              @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=5, timeout=10000)
          </annotation>
       </domain>
    
       <domain name="Strictly Pooled Message Driven Bean" extends="Message Driven Bean" inheritBindings="true">
          <annotation expr="!class(@org.jboss.ejb3.annotation.Pool)">
              @org.jboss.ejb3.annotation.Pool (value="StrictMaxPool", maxSize=5, timeout=10000)
          </annotation>
       </domain>
    </aop>
    

    在链接中找到:http://docs.jboss.org/ejb3/docs/reference/1.0.7/html/SessionBean_and_MDB_configuration.html

    请建议上面解释注释是否是实现和使用strictMaxPool或NOT的正确方法?

    如果它不是正确的方式那么我如何配置相同的“strictMaxPool”通过xml文件或配置文件或注释为基础?

相关问题