@FunctionalInterface public interface TenantDataSourceProvider
DataSource
instance provider.
This interface is used by MultiTenantDataSource
to obtain the concrete DataSource
to use with the
current tenant id.
Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_KEY
Default
Context resource reference |
Modifier and Type | Method and Description |
---|---|
static Optional<TenantDataSourceProvider> |
getCurrent()
Convenience method to obtain the current
TenantDataSourceProvider made available as Context
resource, using default ClassLoader . |
DataSource |
getDataSource(String tenantId)
Provides the concrete
DataSource to use with given tenantId |
static final String CONTEXT_KEY
Context
resource referenceDataSource getDataSource(String tenantId)
DataSource
to use with given tenantId
tenantId
- Tenant idstatic Optional<TenantDataSourceProvider> getCurrent()
TenantDataSourceProvider
made available as Context
resource, using default ClassLoader
.
See Context.resource(String, Class)
for details about context resources availability conditions.
Copyright © 2020 The Holon Platform. All rights reserved.