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

<beans>

   <bean id="attrSessionSizeResourceInterceptor" class="org.alfresco.repo.transaction.SingleEntryTransactionResourceInterceptor" >
      <property name="methodResourceManagers">
         <list>
            <ref bean="attrSessionSizeResourceManager"></ref>
         </list>
      </property>
      <property name="elapsedTimeBeforeActivationMillis">
         <value>500</value>
      </property>
      <property name="resourceManagerCallFrequencyMillis">
         <value>250</value>
      </property>
   </bean>

   <bean id="attrSessionSizeResourceManager" class="org.alfresco.repo.domain.hibernate.SessionSizeResourceManager">
      <property name="sessionFactory">
         <ref bean="sessionFactory" />
      </property>
      <property name="writeThreshold">
         <value>100</value>
      </property>
      <property name="readThreshold">
         <value>100</value>
      </property>
      <property name="retentionFactor">
         <value>0</value>
      </property>
   </bean>
   
    <bean id="attributeService" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="proxyInterfaces">
         <value>org.alfresco.service.cmr.attributes.AttributeService</value>
      </property>
      <property name="target">
         <ref bean="attributeServiceBase"/>
      </property>
      <property name="interceptorNames">
         <list>
            <value>attrSessionSizeResourceInterceptor</value>
         </list>
      </property>
   </bean>


    <bean id="attributeServiceBase" class="org.alfresco.repo.attributes.AttributeServiceImpl">
        <property name="attributeConverter">
            <ref bean="attributeConverter"/>
        </property>
        <property name="globalAttributeEntryDao">
            <ref bean="globalAttributeEntryDAO"/>
        </property>
        <property name="attributeDao">
            <ref bean="attributeDAO"/>
        </property>
    </bean>

    <bean id="attributeConverter" class="org.alfresco.repo.attributes.AttributeConverter"/>

    <bean id="attributeDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="target">
         <ref bean="attributeDAOImpl" />
      </property>
      <property name="interceptorNames">
         <list>
            <value>daoServiceDirtySessionInterceptor</value>
         </list>
      </property>
   </bean>
    
    <bean id="attributeDAOImpl" class="org.alfresco.repo.attributes.hibernate.AttributeDAOHibernate">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="mapEntryDao">
            <ref bean="mapEntryDAO"/>
        </property>
        <property name="listEntryDao">
            <ref bean="listEntryDAO"/>
        </property>
    </bean>

    <bean id="globalAttributeEntryDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="target">
         <ref bean="globalAttributeEntryDAOImpl" />
      </property>
      <property name="interceptorNames">
         <list>
            <value>daoServiceDirtySessionInterceptor</value>
         </list>
      </property>
   </bean>
    
    <bean id="globalAttributeEntryDAOImpl" class="org.alfresco.repo.attributes.hibernate.GlobalAttributeEntryDAOHibernate">
        <property name="sessionFactory">
            <ref bean="sessionFactory"/>
        </property>
        <property name="attributeDao">
            <ref bean="attributeDAO"/>
        </property>
    </bean>

    <bean id="mapEntryDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="target">
         <ref bean="mapEntryDAOImpl" />
      </property>
      <property name="interceptorNames">
         <list>
            <value>daoServiceDirtySessionInterceptor</value>
         </list>
      </property>
   </bean>
    
	<bean id="mapEntryDAOImpl" class="org.alfresco.repo.attributes.hibernate.MapEntryDAOHibernate">
	    <property name="sessionFactory">
	        <ref bean="sessionFactory"/>
	    </property>
	</bean>

    <bean id="listEntryDAO" class="org.springframework.aop.framework.ProxyFactoryBean">
      <property name="target">
         <ref bean="listEntryDAOImpl" />
      </property>
      <property name="interceptorNames">
         <list>
            <value>daoServiceDirtySessionInterceptor</value>
         </list>
      </property>
   </bean>
    
	<bean id="listEntryDAOImpl" class="org.alfresco.repo.attributes.hibernate.ListEntryDAOHibernate">
	    <property name="sessionFactory">
	        <ref bean="sessionFactory"/>
	    </property>
    </bean>
</beans>