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 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 DataSource |
selectAnyDataSource() |
protected DataSource |
selectDataSource(String tenantIdentifier) |
void |
stop()
Stop phase notification
|
getAnyConnection, getConnection, isUnwrappableAs, releaseAnyConnection, releaseConnection, supportsAggressiveRelease, unwrap
public static final String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
selectAnyDataSource()
handlingpublic DataSourceBasedMultiTenantConnectionProviderImpl()
protected DataSource selectAnyDataSource()
selectAnyDataSource
in class AbstractDataSourceBasedMultiTenantConnectionProviderImpl
protected DataSource selectDataSource(String tenantIdentifier)
selectDataSource
in class AbstractDataSourceBasedMultiTenantConnectionProviderImpl
public void injectServices(ServiceRegistryImplementor serviceRegistry)
ServiceRegistryAwareService
injectServices
in interface ServiceRegistryAwareService
serviceRegistry
- The registryCopyright © 2001-2015 Red Hat, Inc. All Rights Reserved.