类 DynamicRoutingDataSource

所有已实现的接口:
Wrapper, CommonDataSource, DataSource, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class DynamicRoutingDataSource extends AbstractRoutingDataSource implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
核心动态数据源组件
从以下版本开始:
1.0.0
作者:
TaoYu Kanyuxia
  • 构造器详细资料

  • 方法详细资料

    • getPrimary

      protected String getPrimary()
      从类复制的说明: AbstractRoutingDataSource
      获取默认数据源名称
      指定者:
      getPrimary 在类中 AbstractRoutingDataSource
      返回:
      名称
    • determineDataSource

      public DataSource determineDataSource()
      从类复制的说明: AbstractRoutingDataSource
      抽象获取连接池
      指定者:
      determineDataSource 在类中 AbstractRoutingDataSource
      返回:
      连接池
    • getDataSources

      public Map<String,DataSource> getDataSources()
      获取所有的数据源
      返回:
      当前所有数据源
    • getGroupDataSources

      public Map<String,GroupDataSource> getGroupDataSources()
      获取的所有的分组数据源
      返回:
      当前所有的分组数据源
    • getDataSource

      public DataSource getDataSource(String ds)
      获取数据源
      参数:
      ds - 数据源名称
      返回:
      数据源
    • addDataSource

      public void addDataSource(String ds, DataSource dataSource)
      添加数据源
      参数:
      ds - 数据源名称
      dataSource - 数据源
    • removeDataSource

      public void removeDataSource(String ds)
      删除数据源
      参数:
      ds - 数据源名称
    • destroy

      public void destroy()
      指定者:
      destroy 在接口中 org.springframework.beans.factory.DisposableBean
    • afterPropertiesSet

      public void afterPropertiesSet()
      指定者:
      afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean