I am very new to hybris e-commerce software and trying to learn with the help of wiki documents provided with it. I see use of 'tenant' scope quite frequently. I know about other scopes like 'singleton', 'prototype' etc. But I am not very clear with the tenant scope. appreciate if someone have a good understanding about this scope, and explain in simple terms. Thanks.
问问题
19505 次
3 回答
22
核心扩展的 core-spring.xml 文件在全局 ApplicationContext 中添加了一个名为 tenant 的特殊范围。租户范围确保为 hybris 的每个单独租户单独实例化 bean,而单例只会创建一个实例供所有租户使用。
如果您在实现中引用特定于租户的类(如服务或 DAO),则必须使用租户范围而不是默认的 Spring 单例范围。如有疑问,请使用租户而不是单例。
<bean id="myExtension.myBean" class="de.hybris.platform.myExtension.myClass" scope="tenant" />
自 hybris Commerce Suite 5.0 版起,租户范围不再使用。
检查此以获取更多详细信息...
于 2013-11-25T17:12:38.753 回答
5
Hybris 默认有 2 个租户——主租户和 junit 租户。您可以根据需要创建更多租户。每个租户都有自己的一组数据……比如项目类型。
当在租户范围内定义 bean 时,这意味着该 bean 将为每个租户实例化一次。并且整个租户都将使用相同的 bean 对象。
于 2014-07-10T11:41:19.407 回答
4
hybris 可以在多租户模式下运行,在单个 hybris 安装上维护多个单独的数据集。
当一个 bean 定义了一个租户范围时,它只会为每个租户单独实例化;而单例只会创建一个实例供所有租户使用。
于 2013-11-23T04:34:59.237 回答