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,
unless
spring.test.database.hsql is set to true (see
JpaEmbeddedDataSourceFactoryBeanRegistrar). Successful configuration expects that a valid
JpaPropertyRelated properties 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 of
JpaDataRoute.routeKey() appended by "DataSource". If a datasource with the bean id of
JpaDataRoute.routeKey() appended by "DataSource" is present already, then this registrar
is automatically skipped.- Author:
- Jeff Fischer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected 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) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.annotation.ImportBeanDefinitionRegistrar
registerBeanDefinitions
-
Constructor Details
-
JpaPooledDataSourceFactoryBeanRegistrar
public JpaPooledDataSourceFactoryBeanRegistrar()
-
-
Method Details
-
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
-
isHikariAvailable
protected boolean isHikariAvailable()
-