public class DynamicRoutingDataSource
extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.slf4j.Logger |
logger |
protected static Field |
resolvedDataSourcesField |
protected static Field |
targetDataSourcesField |
| 构造器和说明 |
|---|
DynamicRoutingDataSource() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
protected Object |
determineCurrentLookupKey() |
Map<Object,DataSource> |
getResolvedDataSources() |
Map<Object,Object> |
getTargetDataSources() |
void |
removeTargetDataSource(String name) |
void |
setNewTargetDataSources(Map<Object,Object> targetDataSources)
为动态数据源设置新的数据源目标源集合
|
void |
setTargetDataSource(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties properties,
DruidProperties druidProperties,
DynamicDataSourceSetting dsSetting)
为动态数据源设置新的数据源目标源集
|
void |
setTargetDataSource(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties properties,
DruidProperties druidProperties,
String name,
String url,
String username,
String password) |
determineTargetDataSource, getConnection, getConnection, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrapprotected final org.slf4j.Logger logger
protected static Field targetDataSourcesField
protected static Field resolvedDataSourcesField
protected Object determineCurrentLookupKey()
determineCurrentLookupKey 在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourcepublic Map<Object,DataSource> getResolvedDataSources()
public void setTargetDataSource(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties properties,
DruidProperties druidProperties,
String name,
String url,
String username,
String password)
public void setTargetDataSource(org.springframework.boot.autoconfigure.jdbc.DataSourceProperties properties,
DruidProperties druidProperties,
DynamicDataSourceSetting dsSetting)
properties - druidProperties - dsSetting - public void setNewTargetDataSources(Map<Object,Object> targetDataSources)
targetDataSources - public void removeTargetDataSource(String name)
public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanafterPropertiesSet 在类中 org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSourceCopyright © 2018. All rights reserved.