Package org.alfresco.repo.tenant
Class TenantRoutingDataSource
- java.lang.Object
-
- org.springframework.jdbc.datasource.AbstractDataSource
-
- org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-
- org.alfresco.repo.tenant.TenantRoutingDataSource
-
- All Implemented Interfaces:
Wrapper,CommonDataSource,DataSource,org.springframework.beans.factory.InitializingBean
public class TenantRoutingDataSource extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourceExperimental- Since:
- 4.2
- Author:
- janv
-
-
Constructor Summary
Constructors Constructor Description TenantRoutingDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTenantDataSource(String tenantDomain, String dbUrl)voidafterPropertiesSet()protected ObjectdetermineCurrentLookupKey()voidremoveTenantDataSource(String tenantDomain)voidsetBaseDataSource(org.apache.commons.dbcp.BasicDataSource baseDataSource)voidsetTenantService(org.alfresco.repo.tenant.TenantService tenantService)-
Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
determineTargetDataSource, getConnection, getConnection, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrap
-
Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource
getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder
-
-
-
-
Method Detail
-
setTenantService
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
-
setBaseDataSource
public void setBaseDataSource(org.apache.commons.dbcp.BasicDataSource baseDataSource)
-
determineCurrentLookupKey
protected Object determineCurrentLookupKey()
- Specified by:
determineCurrentLookupKeyin classorg.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Overrides:
afterPropertiesSetin classorg.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-
addTenantDataSource
public void addTenantDataSource(String tenantDomain, String dbUrl) throws SQLException
- Throws:
SQLException
-
removeTenantDataSource
public void removeTenantDataSource(String tenantDomain) throws SQLException
- Throws:
SQLException
-
-