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
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected void
registerBean
(org.springframework.beans.factory.support.BeanDefinitionRegistry registry, Map<String, Object> attributes) void
registerBeanDefinitions
(org.springframework.core.type.AnnotationMetadata importingClassMetadata, org.springframework.beans.factory.support.BeanDefinitionRegistry registry) void
setBeanFactory
(org.springframework.beans.factory.BeanFactory beanFactory) void
setEnvironment
(org.springframework.core.env.Environment environment) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
registerBeanDefinitions
in interfaceorg.springframework.context.annotation.ImportBeanDefinitionRegistrar
-
setEnvironment
public void setEnvironment(org.springframework.core.env.Environment environment) - Specified by:
setEnvironment
in interfaceorg.springframework.context.EnvironmentAware
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) - Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
-
registerBean
-
isHikariAvailable
protected boolean isHikariAvailable()
-