Class R2dbcMybatisMultiConnectionFactoryAutoInitializer

java.lang.Object
pro.chenggang.project.reactive.mybatis.support.r2dbc.spring.configuration.routing.R2dbcMybatisMultiConnectionFactoryAutoInitializer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

@Configuration @ConditionalOnProperty(value="spring.r2dbc.mybatis.routing.enabled", havingValue="true") public class R2dbcMybatisMultiConnectionFactoryAutoInitializer extends Object implements org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
The r2dbc mybatis multi connection factory bean auto initializer.
Since:
2.0.0
Version:
1.0.0
Author:
Gang Cheng
  • Constructor Details

    • R2dbcMybatisMultiConnectionFactoryAutoInitializer

      public R2dbcMybatisMultiConnectionFactoryAutoInitializer()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • registerConnectionFactoryBean

      protected void registerConnectionFactoryBean(R2dbcMybatisConnectionFactoryProperties r2dbcMybatisConnectionFactoryProperties, org.springframework.beans.factory.ObjectProvider<ConnectionFactoryOptionsCustomizer> connectionFactoryOptionsCustomizerProvider, String specificBeanName)
      Register connection factory bean.
      Parameters:
      r2dbcMybatisConnectionFactoryProperties - the r2dbc mybatis connection factory properties
      connectionFactoryOptionsCustomizerProvider - the connection factory options customizer provider
      specificBeanName - the specific bean name
    • getConnectionPoolConfiguration

      protected io.r2dbc.pool.ConnectionPoolConfiguration getConnectionPoolConfiguration(R2dbcMybatisConnectionFactoryProperties r2DbcMybatisConnectionFactoryProperties, org.springframework.beans.factory.ObjectProvider<ConnectionFactoryOptionsCustomizer> connectionFactoryOptionsCustomizerProvider)
      Gets connection pool configuration.
      Parameters:
      r2DbcMybatisConnectionFactoryProperties - the r2dbc mybatis connection factory properties
      connectionFactoryOptionsCustomizerProvider - the connection factory options customizer provider
      Returns:
      the connection pool configuration
    • 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