Some more modification to make things more Spring friendly. Updated

Spring configurations to match.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3278 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-04 14:34:50 +00:00
parent 37843668a4
commit b05422171a
13 changed files with 260 additions and 235 deletions

View File

@@ -2,9 +2,72 @@
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="hibernateHelper" class="org.alfresco.repo.avm.hibernate.HibernateHelper"
destroy-method="shutdown">
<!-- Use substitution values in this config. -->
<bean id="configurationProperties"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>config/alfresco/avm-test.properties</value>
</list>
</property>
</bean>
<!-- Datasource -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass">
<value>${db.driver}</value>
</property>
<property name="jdbcUrl">
<value>${db.url}</value>
</property>
<property name="user">
<value>${db.username}</value>
</property>
<property name="password">
<value>${db.password}</value>
</property>
<property name="initialPoolSize">
<value>${db.pool.initial}</value>
</property>
<property name="maxPoolSize" >
<value>${db.pool.max}</value>
</property>
<property name="numHelperThreads">
<value>1</value>
</property>
</bean>
<!-- The SessionFactory for hibernate. -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.current_session_context_class">${hibernate.current_session_context_class}</prop>
<prop key="hibernate.connection.isolation">${hibernate.connection.isolation}</prop>
<prop key="hibernate.default_batch_fetch_size">${hibernate.default_batch_fetch_size}</prop>
<prop key="hibernate.jdbc.batch_versioned_data">${hibernate.jdbc.batch_versioned_data}</prop>
<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/alfresco/repo/avm/hibernate/AVM.hbm.xml</value>
</list>
</property>
</bean>
<!-- The Hibernate Transaction wrapper. -->
<bean id="hibernateTxn" class="org.alfresco.repo.avm.hibernate.HibernateTxn">
<property name="sessionFactory">
<ref bean="sessionFactory"/>
</property>
</bean>
<bean id="orphanReaper" class="org.alfresco.repo.avm.OrphanReaper"
init-method="init" destroy-method="shutDown" depends-on="avmService">
<property name="inactiveBaseSleep">
@@ -16,20 +79,21 @@
<property name="batchSize">
<value>50</value>
</property>
<property name="hibernateHelper">
<ref bean="hibernateHelper"/>
<property name="hibernateTxn">
<ref bean="hibernateTxn"/>
</property>
</bean>
<bean id="avmService" class="org.alfresco.repo.avm.AVMServiceImpl"
init-method="init">
<property name="storage">
<value>build/test-results/storage</value>
</property>
<property name="createTables">
<value>true</value>
<property name="initialize">
<value>${avm.initialize}</value>
</property>
<property name="hibernateHelper">
<ref bean="hibernateHelper"/>
<property name="hibernateTxn">
<ref bean="hibernateTxn"/>
</property>
</bean>
</beans>