类 DataSourceBasedMultiTenantConnectionProviderImpl
- java.lang.Object
-
- org.hibernate.engine.jdbc.connections.spi.AbstractDataSourceBasedMultiTenantConnectionProviderImpl
-
- org.hibernate.engine.jdbc.connections.spi.DataSourceBasedMultiTenantConnectionProviderImpl
-
- 所有已实现的接口:
Serializable,MultiTenantConnectionProvider,Service,ServiceRegistryAwareService,Stoppable,Wrapped
public class DataSourceBasedMultiTenantConnectionProviderImpl extends AbstractDataSourceBasedMultiTenantConnectionProviderImpl implements ServiceRegistryAwareService, Stoppable
A concrete implementation of theMultiTenantConnectionProvidercontract bases on a number of reasonable assumptions. We assume that:-
The
DataSourceinstances are all available from JNDI named by the tenant identifier relative to a single base JNDI context -
AvailableSettings.DATASOURCEis a string naming either the any data source or the base JNDI context. If the latter,TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEYmust also be set.
- 作者:
- Steve Ebersole
- 另请参阅:
- 序列化表格
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringTENANT_IDENTIFIER_TO_USE_FOR_ANY_KEYIdentifies the DataSource name to use forselectAnyDataSource()handling
-
构造器概要
构造器 构造器 说明 DataSourceBasedMultiTenantConnectionProviderImpl()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidinjectServices(ServiceRegistryImplementor serviceRegistry)Callback to inject the registry.protected DataSourceselectAnyDataSource()protected DataSourceselectDataSource(String tenantIdentifier)voidstop()Stop phase notification-
从类继承的方法 org.hibernate.engine.jdbc.connections.spi.AbstractDataSourceBasedMultiTenantConnectionProviderImpl
getAnyConnection, getConnection, isUnwrappableAs, releaseAnyConnection, releaseConnection, supportsAggressiveRelease, unwrap
-
-
-
-
字段详细资料
-
TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
public static final String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
Identifies the DataSource name to use forselectAnyDataSource()handling- 另请参阅:
- 常量字段值
-
-
方法详细资料
-
selectAnyDataSource
protected DataSource selectAnyDataSource()
-
selectDataSource
protected DataSource selectDataSource(String tenantIdentifier)
-
injectServices
public void injectServices(ServiceRegistryImplementor serviceRegistry)
从接口复制的说明:ServiceRegistryAwareServiceCallback to inject the registry.- 指定者:
injectServices在接口中ServiceRegistryAwareService- 参数:
serviceRegistry- The registry
-
-