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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected io.r2dbc.pool.ConnectionPoolConfigurationgetConnectionPoolConfiguration(R2dbcMybatisConnectionFactoryProperties r2DbcMybatisConnectionFactoryProperties, org.springframework.beans.factory.ObjectProvider<ConnectionFactoryOptionsCustomizer> connectionFactoryOptionsCustomizerProvider) Gets connection pool configuration.protected voidregisterConnectionFactoryBean(R2dbcMybatisConnectionFactoryProperties r2dbcMybatisConnectionFactoryProperties, org.springframework.beans.factory.ObjectProvider<ConnectionFactoryOptionsCustomizer> connectionFactoryOptionsCustomizerProvider, String specificBeanName) Register connection factory bean.voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)
-
Constructor Details
-
R2dbcMybatisMultiConnectionFactoryAutoInitializer
public R2dbcMybatisMultiConnectionFactoryAutoInitializer()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.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 propertiesconnectionFactoryOptionsCustomizerProvider- the connection factory options customizer providerspecificBeanName- 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 propertiesconnectionFactoryOptionsCustomizerProvider- 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-