gpt4 book ai didi

java - ejb bean 实例池 jboss EAP 6.1

转载 作者:行者123 更新时间:2023-11-29 05:28:57 24 4
gpt4 key购买 nike

在我们的项目中,我们正在从 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 个实例,还是无论无状态 EJB bean 的数量如何,池最多只能有 20 个实例。

最佳答案

我不同意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();
}

正如我所见,池是非静态字段,是为每种类型的组件(ejb 类)创建的。

关于java - ejb bean 实例池 jboss EAP 6.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21777299/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com