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, unwrap
public static final java.lang.String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
selectAnyDataSource()
handlingpublic DataSourceBasedMultiTenantConnectionProviderImpl()
protected javax.sql.DataSource selectAnyDataSource()
selectAnyDataSource
in class AbstractDataSourceBasedMultiTenantConnectionProviderImpl
protected javax.sql.DataSource selectDataSource(java.lang.String tenantIdentifier)
selectDataSource
in class AbstractDataSourceBasedMultiTenantConnectionProviderImpl
public void injectServices(ServiceRegistryImplementor serviceRegistry)
ServiceRegistryAwareService
injectServices
in interface ServiceRegistryAwareService
serviceRegistry
- The registryCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.