@ApplicationScoped in a cluster

荒凉一梦 提交于 2019-12-10 14:05:28

问题


I don't have a clustered environment at present, but I was curious about @ApplicationScoped behaviour in a clustered environment. Is there going to be only one across the cluster or is still still one per JVM in the cluster?

I have read that @Singleton gets created per JVM in

How singleton is javax.ejb.Singleton in a clustered environment?


回答1:


References to @ApplicationScoped are proxied, so they will be correctly resolved by the CDI container. That holds true no matter how many nodes are present within the application; the state and instance is shared across all client requests.



来源:https://stackoverflow.com/questions/32062511/applicationscoped-in-a-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!