Class R2dbcMybatisDynamicRoutingConnectionFactory

java.lang.Object
org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory
pro.chenggang.project.reactive.mybatis.support.r2dbc.spring.routing.R2dbcMybatisDynamicRoutingConnectionFactory
All Implemented Interfaces:
io.r2dbc.spi.ConnectionFactory, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class R2dbcMybatisDynamicRoutingConnectionFactory extends org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory implements org.springframework.context.ApplicationContextAware
The r2dbc mybatis dynamic routing connection factory
Since:
2.0.0
Version:
1.0.0
Author:
Gang Cheng
  • Constructor Details

    • R2dbcMybatisDynamicRoutingConnectionFactory

      public R2dbcMybatisDynamicRoutingConnectionFactory(DynamicRoutingConnectionFactoryLoader dynamicRoutingConnectionFactoryLoader)
    • R2dbcMybatisDynamicRoutingConnectionFactory

      public R2dbcMybatisDynamicRoutingConnectionFactory(io.r2dbc.spi.ConnectionFactory defaultConnectionFactory, DynamicRoutingConnectionFactoryLoader dynamicRoutingConnectionFactoryLoader)
  • Method Details

    • getMetadata

      public io.r2dbc.spi.ConnectionFactoryMetadata getMetadata()
      Specified by:
      getMetadata in interface io.r2dbc.spi.ConnectionFactory
      Overrides:
      getMetadata in class org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory
    • determineCurrentLookupKey

      protected reactor.core.publisher.Mono<Object> determineCurrentLookupKey()
      Specified by:
      determineCurrentLookupKey in class org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory
    • determineTargetConnectionFactory

      public reactor.core.publisher.Mono<io.r2dbc.spi.ConnectionFactory> determineTargetConnectionFactory()
      Expose determineTargetConnectionFactory operation from AbstractRoutingConnectionFactory.determineTargetConnectionFactory()
      Overrides:
      determineTargetConnectionFactory in class org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory
      Returns:
      emitting the current connection factory
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.r2dbc.connection.lookup.AbstractRoutingConnectionFactory
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • loadConnectionFactory

      protected Map<?,io.r2dbc.spi.ConnectionFactory> loadConnectionFactory()
      Load all connection factories
      Returns:
      all target connection factories