All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.dynamic-data-source-spring.xml Maven / Gradle / Ivy

There is a newer version: 7.0.0-nightly
Show newest version
<?xml version="1.0"?>

<beans
	default-destroy-method="destroy"
	default-init-method="afterPropertiesSet"
	xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"
>
	<bean id="chainableMethodAdviceInjector.dynamicDataSourceAdvice" class="com.liferay.portal.spring.aop.ChainableMethodAdviceInjector">
		<property name="childMethodInterceptor" ref="transactionAdvice" />
		<property name="injectCondition" value="true" />
		<property name="newChainableMethodAdvice" ref="dynamicDataSourceAdvice" />
		<property name="parentChainableMethodAdvice" ref="serviceAdvice" />
	</bean>
	<bean id="dynamicDataSourceAdvice" class="com.liferay.portal.dao.jdbc.aop.DynamicDataSourceAdvice">
		<property name="dynamicDataSourceTargetSource" ref="dynamicDataSourceTargetSource" />
		<property name="transactionAttributeSource" ref="transactionAttributeSource" />
	</bean>
	<bean name="dynamicDataSourceTargetSource" class="com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTargetSource">
		<property name="readDataSource">
			<bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
				<property name="propertyPrefix" value="jdbc.read." />
			</bean>
		</property>
		<property name="writeDataSource">
			<bean class="com.liferay.portal.dao.jdbc.spring.DataSourceFactoryBean">
				<property name="propertyPrefix" value="jdbc.write." />
			</bean>
		</property>
	</bean>
	<bean id="liferayDataSource" class="org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy">
		<property name="targetDataSource">
			<bean class="org.springframework.aop.framework.ProxyFactoryBean">
				<property name="targetSource" ref="dynamicDataSourceTargetSource" />
			</bean>
		</property>
	</bean>
	<bean id="com.liferay.portal.kernel.util.InfrastructureUtil" class="com.liferay.portal.kernel.util.InfrastructureUtil">
		<property name="dataSource" ref="liferayDataSource" />
		<property name="dynamicDataSourceTargetSource" ref="dynamicDataSourceTargetSource" />
		<property name="mailSession" ref="mailSession" />
		<property name="transactionManager" ref="liferayTransactionManager" />
	</bean>
</beans>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy