Class JpaPooledDataSourceFactoryBeanRegistrar
- java.lang.Object
-
- com.broadleafcommerce.common.jpa.data.entitymanager.JpaPooledDataSourceFactoryBeanRegistrar
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.context.annotation.ImportBeanDefinitionRegistrar,org.springframework.context.EnvironmentAware
public class JpaPooledDataSourceFactoryBeanRegistrar extends Object implements org.springframework.context.annotation.ImportBeanDefinitionRegistrar, org.springframework.context.EnvironmentAware, org.springframework.beans.factory.BeanFactoryAware
Registers a pooling datasource bean definition. This definition represent the default behavior, unlessspring.test.database.hsqlis set to true (seeJpaEmbeddedDataSourceFactoryBeanRegistrar). Successful configuration expects that a validJpaPropertyRelatedproperties class is configured with the appropriate settings to connect to the backing datastore. This implementation assumes Hikari connection pool as the datasource pooling implementation. If a different pooling approach is desired, end implementations should explicitly declare a datasource with the bean id ofJpaDataRoute.routeKey()appended by "DataSource". If a datasource with the bean id ofJpaDataRoute.routeKey()appended by "DataSource" is present already, then this registrar is automatically skipped.- Author:
- Jeff Fischer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJpaPooledDataSourceFactoryBeanRegistrar.PooledDatasourceFactoryBeanstatic classJpaPooledDataSourceFactoryBeanRegistrar.PropertySourceUtility
-
Constructor Summary
Constructors Constructor Description JpaPooledDataSourceFactoryBeanRegistrar()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisHikariAvailable()protected voidregisterBean(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, Map<String,Object> attributes)voidregisterBeanDefinitions(org.springframework.core.type.AnnotationMetadata importingClassMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidsetEnvironment(org.springframework.core.env.Environment environment)
-
-
-
Method Detail
-
registerBeanDefinitions
public void registerBeanDefinitions(org.springframework.core.type.AnnotationMetadata importingClassMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry registry)- Specified by:
registerBeanDefinitionsin interfaceorg.springframework.context.annotation.ImportBeanDefinitionRegistrar
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment)
- Specified by:
setEnvironmentin interfaceorg.springframework.context.EnvironmentAware
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware
-
registerBean
protected void registerBean(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, Map<String,Object> attributes)
-
isHikariAvailable
protected boolean isHikariAvailable()
-
-