在Hybris中,租户范围是什么?

时间:2022-06-01 22:00:37

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.

我对hybris电子商务软件非常陌生,并试图通过提供的wiki文档来学习。我经常看到“租户”范围的使用。我知道其他的作用域,比如“单例”、“原型”等等,但是我不太清楚租户作用域。如果有人对这个范围有很好的理解,请表示感谢,并用简单的术语解释。谢谢。

3 个解决方案

#1


20  

The core-spring.xml file of the core extension adds a special scope named tenant to the global ApplicationContext. The tenant scope makes sure that the bean is instantiated individually for each individual tenant of the hybris, whereas singleton would create only one instance for all tenants to use.

核心spring。核心扩展的xml文件向全局应用程序上下文添加了一个名为承租者的特殊范围。租户作用域确保对hybris的每个租户单独实例化bean,而singleton只会为所有租户创建一个实例。

If you reference tenant-specific classes like services or DAOs inside your implementation, you have to use the tenant scope instead of the default Spring singleton scope. In case of doubt, use tenant instead of singleton.

如果在实现中引用特定于租户的类,如服务或dao,则必须使用承租者范围而不是默认的Spring singleton范围。如果有疑问,请使用租户而不是单例。

<bean id="myExtension.myBean" class="de.hybris.platform.myExtension.myClass" scope="tenant" />

Since version 5.0 of hybris Commerce Suite, tenant scope is no longer in use.

由于hybris Commerce Suite 5.0版本,租户范围不再使用。

Check this for more details...

更多细节请看这里……

#2


4  

Hybris has 2 tenants by default- master tenant and junit tenant. You can create more tenants as required. Each tenant has its own set of data...say item types.

Hybris默认有两个租户——主租户和junit租户。您可以根据需要创建更多的租户。每个租户都有自己的数据集……说项类型。

When a bean is defined in a tenant scope, it means that, that bean would be instantiated once for each tenant. And the same bean object would be used throughout the tenant.

当一个bean在一个租户范围中定义时,这意味着,该bean将为每个租户实例化一次。同样的bean对象将在整个租户中使用。

#3


3  

hybris can be run in a Multi-Tenant mode which multiple individual sets of data are maintained on one single hybris installation.

hybris可以在多租户模式下运行,在单个的hybris安装上维护多个独立的数据集。

When a bean is defined with a tenant scope, it will only be instantiated individually for each tenant; whereas singleton would create only one instance for all tenants to use.

当用承租者范围定义bean时,它将仅为每个承租者单独实例化;而singleton只为所有租户创建一个实例供其使用。

#1


20  

The core-spring.xml file of the core extension adds a special scope named tenant to the global ApplicationContext. The tenant scope makes sure that the bean is instantiated individually for each individual tenant of the hybris, whereas singleton would create only one instance for all tenants to use.

核心spring。核心扩展的xml文件向全局应用程序上下文添加了一个名为承租者的特殊范围。租户作用域确保对hybris的每个租户单独实例化bean,而singleton只会为所有租户创建一个实例。

If you reference tenant-specific classes like services or DAOs inside your implementation, you have to use the tenant scope instead of the default Spring singleton scope. In case of doubt, use tenant instead of singleton.

如果在实现中引用特定于租户的类,如服务或dao,则必须使用承租者范围而不是默认的Spring singleton范围。如果有疑问,请使用租户而不是单例。

<bean id="myExtension.myBean" class="de.hybris.platform.myExtension.myClass" scope="tenant" />

Since version 5.0 of hybris Commerce Suite, tenant scope is no longer in use.

由于hybris Commerce Suite 5.0版本,租户范围不再使用。

Check this for more details...

更多细节请看这里……

#2


4  

Hybris has 2 tenants by default- master tenant and junit tenant. You can create more tenants as required. Each tenant has its own set of data...say item types.

Hybris默认有两个租户——主租户和junit租户。您可以根据需要创建更多的租户。每个租户都有自己的数据集……说项类型。

When a bean is defined in a tenant scope, it means that, that bean would be instantiated once for each tenant. And the same bean object would be used throughout the tenant.

当一个bean在一个租户范围中定义时,这意味着,该bean将为每个租户实例化一次。同样的bean对象将在整个租户中使用。

#3


3  

hybris can be run in a Multi-Tenant mode which multiple individual sets of data are maintained on one single hybris installation.

hybris可以在多租户模式下运行,在单个的hybris安装上维护多个独立的数据集。

When a bean is defined with a tenant scope, it will only be instantiated individually for each tenant; whereas singleton would create only one instance for all tenants to use.

当用承租者范围定义bean时,它将仅为每个承租者单独实例化;而singleton只为所有租户创建一个实例供其使用。