public class DataSourceBasedMultiTenantConnectionProviderImpl extends AbstractDataSourceBasedMultiTenantConnectionProviderImpl implements ServiceRegistryAwareService, Stoppable
MultiTenantConnectionProvider contract bases on a number of
reasonable assumptions. We assume that:DataSource instances are all available from JNDI named by the tenant identifier relative
to a single base JNDI context
AvailableSettings.DATASOURCE is a string naming either the any
data source or the base JNDI context. If the latter, TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY must
also be set.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
Identifies the DataSource name to use for
selectAnyDataSource() handling |
| Constructor and Description |
|---|
DataSourceBasedMultiTenantConnectionProviderImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
injectServices(ServiceRegistryImplementor serviceRegistry)
Callback to inject the registry.
|
protected javax.sql.DataSource |
selectAnyDataSource() |
protected javax.sql.DataSource |
selectDataSource(java.lang.String tenantIdentifier) |
void |
stop()
Stop phase notification
|
getAnyConnection, getConnection, isUnwrappableAs, releaseAnyConnection, releaseConnection, supportsAggressiveRelease, unwrappublic static final java.lang.String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
selectAnyDataSource() handlingpublic DataSourceBasedMultiTenantConnectionProviderImpl()
protected javax.sql.DataSource selectAnyDataSource()
selectAnyDataSource in class AbstractDataSourceBasedMultiTenantConnectionProviderImplprotected javax.sql.DataSource selectDataSource(java.lang.String tenantIdentifier)
selectDataSource in class AbstractDataSourceBasedMultiTenantConnectionProviderImplpublic void injectServices(ServiceRegistryImplementor serviceRegistry)
ServiceRegistryAwareServiceinjectServices in interface ServiceRegistryAwareServiceserviceRegistry - The registryCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.