繁体   English   中英

ejb bean实例池jboss EAP 6.1

[英]ejb bean instance pool jboss EAP 6.1

在我们的项目中,我们将从JBoss5迁移到Jboss EAP 6.1。 当我在Jboss EAP 6.1中使用配置时,我偶然发现:

<pools>
<bean-instance-pools>
<strict-max-pool name="slsb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="1" instance-acquisitiontimeout-unit="MILLISECONDS"/>
<strict-max-pool name="mdb-strict-max-pool" max-pool-size="20" instance-acquisition-timeout="1" instance-acquisitiontimeout-unit="MILLISECONDS"/>
</bean-instance-pools>
</pools>

我不清楚max-pool-size参数。这个限制在JBoss或池上部署的每个无状态EJB bean的20个实例最多只能有20个实例,而不管无状态EJB bean的数量。

我不同意eis。 这是Wildfly 8.2.1 StatelessSessionComponent.java的代码

public StatelessSessionComponent(final StatelessSessionComponentCreateService slsbComponentCreateService) {
    super(slsbComponentCreateService);

    StatelessObjectFactory<StatelessSessionComponentInstance> factory = new StatelessObjectFactory<StatelessSessionComponentInstance>() {
        @Override
        public StatelessSessionComponentInstance create() {
            return (StatelessSessionComponentInstance) createInstance();
        }

        @Override
        public void destroy(StatelessSessionComponentInstance obj) {
            obj.destroy();
        }
    };
    final PoolConfig poolConfig = slsbComponentCreateService.getPoolConfig();
    if (poolConfig == null) {
        ROOT_LOGGER.debug("Pooling is disabled for Stateless EJB " + slsbComponentCreateService.getComponentName());
        this.pool = null;
        this.poolName = null;
    } else {
        ROOT_LOGGER.debug("Using pool config " + poolConfig + " to create pool for Stateless EJB " + slsbComponentCreateService.getComponentName());
        this.pool = poolConfig.createPool(factory);
        this.poolName = poolConfig.getPoolName();
    }

    this.timeoutMethod = slsbComponentCreateService.getTimeoutMethod();
    this.weakAffinity = slsbComponentCreateService.getWeakAffinity();
}

我认为pool是非静态字段,并且是为每种类型的Component(ejb类)创建的。

红帽文档

bean池的最大大小。

另外,如果你去EAP的管理面板并转到Profile - > Container - > EJB3 - > Bean Pools - >“需要帮助?” 它说

最大池大小:池在给定时间点可以容纳的最大Bean实例数

我认为这意味着池最多只能有20个实例。


编辑:回想起来, 谢尔盖Kosarev回答说,每个实例似乎足够令人信服,你可能应该相信。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM