Package com.almis.awe.component
Class AweRoutingDataSource
- java.lang.Object
-
- org.springframework.jdbc.datasource.AbstractDataSource
-
- org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-
- com.almis.awe.component.AweRoutingDataSource
-
- All Implemented Interfaces:
Wrapper
,CommonDataSource
,DataSource
,org.springframework.beans.factory.InitializingBean
public class AweRoutingDataSource extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Routing datasource- Author:
- pgarcia
-
-
Constructor Summary
Constructors Constructor Description AweRoutingDataSource(AweDatabaseContextHolder contextHolder)
Autowired constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
protected Object
determineCurrentLookupKey()
Get lookup keyvoid
loadDataSources()
Load datasources from current connectionvoid
reloadDataSources()
Load datasources from current connection-
Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
determineTargetDataSource, getConnection, getConnection, getResolvedDataSources, getResolvedDefaultDataSource, 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
-
-
-
-
Constructor Detail
-
AweRoutingDataSource
public AweRoutingDataSource(AweDatabaseContextHolder contextHolder)
Autowired constructor- Parameters:
contextHolder
- Awe Database Context holder
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Overrides:
afterPropertiesSet
in classorg.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
-
loadDataSources
public void loadDataSources()
Load datasources from current connection
-
reloadDataSources
public void reloadDataSources()
Load datasources from current connection
-
determineCurrentLookupKey
protected Object determineCurrentLookupKey()
Get lookup key- Specified by:
determineCurrentLookupKey
in classorg.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
- Returns:
- Current database
-
-