Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2010 The Kuali Foundation Licensed under the
    Educational Community License, Version 2.0 (the "License"); you may
    not use this file except in compliance with the License. You may
    obtain a copy of the License at

    http://www.osedu.org/licenses/ECL-2.0

    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an "AS IS"
    BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
    or implied. See the License for the specific language governing
    permissions and limitations under the License.

-->

<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:ws="http://jax-ws.dev.java.net/spring/core"
	xmlns:wss="http://jax-ws.dev.java.net/spring/servlet"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:p="http://www.springframework.org/schema/p"
	xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jee="http://www.springframework.org/schema/jee"
	xmlns:tx="http://www.springframework.org/schema/tx"
	xsi:schemaLocation="
          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
		  http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd 
          http://jax-ws.dev.java.net/spring/core http://jax-ws.dev.java.net/spring/core.xsd 
          http://jax-ws.dev.java.net/spring/servlet http://jax-ws.dev.java.net/spring/servlet.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
    	  http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
		  http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

	<context:annotation-config/>
	
    <import resource="classpath:META-INF/default-property-config-context-test.xml"/>
	<import resource="classpath:*-mock-dao-context.xml" />

	<bean id="systemPropertyConfigurer"
		class="org.kuali.student.common.util.SystemPropertyConfigurer">
		<property name="properties" value="${propertiesPrefix.systemProperties}"/>
	</bean>

	<bean id="dataSource"
		class="org.kuali.student.common.test.spring.UniqueResourceAtomikosDataSourceBean" init-method="init"
		destroy-method="close" depends-on="systemPropertyConfigurer">
		<property name="uniqueResourceName" value="dataSource" />
		<property name="xaDataSourceClassName"
			value="${jdbc.xaDataSourceClassName}" />
		<property name="xaProperties" value="${propertiesPrefix.jdbc.xaDataSourceProperties}"/>
		<property name="maxPoolSize" value="${jdbc.maxPoolSize}" />
	</bean>

	<!-- JPA EntityManagerFactory -->
	<bean id="postProcessorList" class="java.util.ArrayList">
		<constructor-arg index="0">
			<list>
				<bean id="ricePostProcessor"
					class="org.kuali.rice.core.jpa.spring.RicePersistenceUnitPostProcessor">
					<property name="jtaDataSource"
						ref="dataSource" />
				</bean>
			</list>
		</constructor-arg>
	</bean>

	<bean id="vendorAdapter" class="${jpa.vendorAdapter}" depends-on="propertyConfigurer">
		<property name="databasePlatform"
			value="${jpa.databasePlatform}" />
		<property name="showSql" value="${jpa.showSql}" />
		<property name="generateDdl" value="${jpa.generateDdl}" />
	</bean>

	<bean id="entityManagerFactory"
		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
		<property name="jpaVendorAdapter" ref="vendorAdapter" />
		<property name="persistenceXmlLocation"
			value="${ks.test.persistenceLocation}" />
		<property name="dataSource" ref="dataSource" />
		<property name="jpaPropertyMap" value="${propertiesPrefix.jpa.properties}"/>
		<property name="persistenceUnitPostProcessors" ref="postProcessorList" />
	</bean>

	<bean id="AtomikosTxMgr"
		class="com.atomikos.icatch.jta.UserTransactionManager"
		init-method="init" destroy-method="close" depends-on="systemPropertyConfigurer">
		<property name="forceShutdown" value="true" />
		<property name="startupTransactionService" value="true" />
		<property name="transactionTimeout" value="60" />
	</bean>

	<bean id="AtomikosUsrTx"
		class="com.atomikos.icatch.jta.UserTransactionImp" depends-on="systemPropertyConfigurer"></bean>

	<bean id="JtaTxManager"
		class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="systemPropertyConfigurer">
		<property name="transactionManager" ref="AtomikosTxMgr" />
		<property name="userTransaction" ref="AtomikosUsrTx" />
		<property name="transactionSynchronizationName"
			value="SYNCHRONIZATION_ON_ACTUAL_TRANSACTION" />
	</bean>

	<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
		<property name="targetClass" value="org.kuali.student.common.util.jta.AtomikosJtaTransactionController"/>
		<property name="targetMethod" value="setTm"/>
		<property name="arguments">
			<list>
				<ref bean="AtomikosTxMgr"/>
			</list>
		</property>
	</bean>

	<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
		<property name="targetClass" value="org.kuali.student.common.util.jta.AtomikosManagedRuntime"/>
		<property name="targetMethod" value="setTm"/>
		<property name="arguments">
			<list>
				<ref bean="AtomikosTxMgr"/>
			</list>
		</property>
	</bean>

	<aop:aspectj-autoproxy proxy-target-class="true" />

	<tx:annotation-driven transaction-manager="JtaTxManager"
		order="1000" />

	<bean
		class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

</beans>
New to GrepCode? Check out our FAQ X