<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<!--
  - Application context definition for PortletRegistry using Apache OJB.
	-->
<beans>
  
   <!-- ========================= BUSINESS OBJECT DEFINITIONS ========================= -->

  <!-- Preferences Implementation -->
   <bean id="PreferencesProviderImpl" 
  	   class="org.apache.jetspeed.prefs.impl.PersistenceBrokerPreferencesProvider"
  	   init-method="init"
   >  	   
  	   <constructor-arg index="0"><value>META-INF/prefs_repository.xml</value></constructor-arg>  	   
  	   <constructor-arg type="boolean" index="1"><value>true</value></constructor-arg>  	     	   
  </bean>
  
  
  <bean id="org.apache.jetspeed.prefs.PreferencesProvider" parent="baseTransactionProxy" 
  	name="prefsProvider"
  	>
		<property name="proxyInterfaces">
			<value>org.apache.jetspeed.prefs.PreferencesProvider</value>
		</property>

		<property name="target"> 
			<ref bean="PreferencesProviderImpl"/>
		</property>
		<property name="transactionAttributes">
			<props>
				<prop key="createNode*">PROPAGATION_REQUIRED</prop>
				<prop key="storeNode*">PROPAGATION_REQUIRED</prop>
				<prop key="removeNode*">PROPAGATION_REQUIRED</prop>
				<prop key="*">PROPAGATION_SUPPORTS</prop>
			</props>
		</property>
  </bean>
  
  <bean id="java.util.prefs.PreferencesFactory" 
  	class="org.apache.jetspeed.prefs.impl.PreferencesFactoryImpl"
  	name="prefsFactory" init-method="init"
  	>
  		<property name="prefsProvider"> 
			<ref bean="prefsProvider"/>
		</property>	
  </bean>
  
  
   <!-- Property Manager -->
   <bean id="PropertyManagerImpl" 
  	   class="org.apache.jetspeed.prefs.impl.PropertyManagerImpl"
  >  	   
      <!-- We don't use the Tx proxied prefs provider so that we can demarcate Txs
      	   exclusively for the PropertyManager -->
  	   <constructor-arg ><ref bean="PreferencesProviderImpl"/></constructor-arg>  	   
  </bean>
  
  <bean id="org.apache.jetspeed.prefs.PropertyManager" parent="baseTransactionProxy" 
  	     name="propertyManager"
  	     >
		<property name="proxyInterfaces">
			<value>org.apache.jetspeed.prefs.PropertyManager</value>
		</property>

		<property name="target"> 
			<ref bean="PropertyManagerImpl"/>
		</property>		
		<property name="transactionAttributes">
			<props>
				<prop key="add*">PROPAGATION_REQUIRED</prop>
				<prop key="remove*">PROPAGATION_REQUIRED</prop>
				<prop key="update*">PROPAGATION_REQUIRED</prop>
				<prop key="*">PROPAGATION_SUPPORTS</prop>
			</props>
		</property>		
  </bean>


</beans>