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
org.hibernate.cfg.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 |
|---|---|
| private String | |
| private Map | |
| private JndiService | |
| public static final String | TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY
Identifies the DataSource name to use for |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Map | |
| public void | injectServices(ServiceRegistryImplementor
The registry serviceRegistry)Implements org. |
| protected DataSource | |
| protected DataSource | selectDataSource(String tenantIdentifier)
Implements abstract org. |
| public void |
| baseJndiNamespace | back to summary |
|---|---|
| private String baseJndiNamespace | |
| dataSourceMap | back to summary |
|---|---|
| private Map<String, DataSource> dataSourceMap | |
| jndiService | back to summary |
|---|---|
| private JndiService jndiService | |
| TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY | back to summary |
|---|---|
| public static final String TENANT_IDENTIFIER_TO_USE_FOR_ANY_KEY Identifies the DataSource name to use for | |
| tenantIdentifierForAny | back to summary |
|---|---|
| private String tenantIdentifierForAny | |
| DataSourceBasedMultiTenantConnectionProviderImpl | back to summary |
|---|---|
| public DataSourceBasedMultiTenantConnectionProviderImpl() | |
| dataSourceMap | back to summary |
|---|---|
| private Map | |
| injectServices | back to summary |
|---|---|
| public void injectServices(ServiceRegistryImplementor serviceRegistry) Implements org. Doc from org. Callback to inject the registry.
| |
| selectAnyDataSource | back to summary |
|---|---|
| protected DataSource selectAnyDataSource() Implements abstract org.
| |
| selectDataSource | back to summary |
|---|---|
| protected DataSource selectDataSource(String tenantIdentifier) Implements abstract org.
| |
| stop | back to summary |
|---|---|
| public void stop() Implements org. Doc from org. Stop phase notification
| |