<?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 PortletEntity using Apache OJB.
	-->
<beans>	
     <!--
     <bean id="systemCache" class="org.apache.jetspeed.cache.general.SimpleHashMapCache" />
     
     <bean id="systemCachingInterceptor" class="org.apache.jetspeed.components.interceptors.CachingInterceptor" >
    	<constructor-arg>
    		<ref bean="systemCache"/>
    	</constructor-arg>
     </bean>
    
    <bean id="systemRemoveFromCacheInterceptor" class="org.apache.jetspeed.components.interceptors.RemoveFromCacheInterceptor" >
    	<constructor-arg>
    		<ref bean="systemCache"/>
    	</constructor-arg>
    </bean>   	
    
    <bean id="portletEntityCachingAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
        <property name="advice">
             <ref bean="systemCachingInterceptor"/>
        </property>
        <property name="patterns">
         <list>
            <value>.*getPortletEntity.*</value>
        </list>
       </property>
    </bean>
    
    <bean id="portletEntityRemoveFromCacheAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
        <property name="advice">
             <ref bean="systemRemoveFromCacheInterceptor"/>
        </property>
        <property name="patterns">
         <list>
            <value>.*removePortletEntity.*</value>
        </list>
       </property>
    </bean>
    -->
    
    <!--
	  - PortletEntity business object: OJB implementation, as an inner bean wrapped
		- by an outer transactional proxy. The two bean definitions could have been separate,
		- but this is cleaner as there is no need to ever access the unwrapped object.
    -->

    <bean id="portletEntityAccessImpl" class="org.apache.jetspeed.components.portletentity.PersistenceBrokerPortletEntityAccess" >
    	<constructor-arg>
    		<ref bean="portletRegistry"/>    		
    	</constructor-arg>
    </bean>
    

	<bean id="org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent" parent="baseTransactionProxy" 
		name="portletEntityAccess" >
		<property name="proxyInterfaces">
			<value>org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent</value>
		</property>
		<property name="target">
			<ref bean="portletEntityAccessImpl"/>
		</property>
		<!--
		<property name="preInterceptors">
			<list>
				<ref bean="portletEntityCachingAdvisor"/>
				<ref bean="portletEntityRemoveFromCacheAdvisor"/>
			</list>
		</property>
		-->
		<property name="transactionAttributes">
			<props>				
				<prop key="remove*">PROPAGATION_REQUIRED</prop>
				<prop key="store*">PROPAGATION_REQUIRED,-org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException</prop>
				<prop key="*">PROPAGATION_SUPPORTS</prop>
			</props>
		</property>
	</bean>


</beans>