<?xml version="1.0" encoding="UTF-8"?>

<!--
  - Application context containing business beans.
  -
  - Used by all artifacts.
  -
  -->

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">

    <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
        <property name="basename" value="classpath:org/springframework/security/messages"/>
    </bean>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="org.hsqldb.jdbcDriver"/>
        <property name="url" value="jdbc:hsqldb:mem:test"/>
        <!-- <value>jdbc:hsqldb:hsql://localhost/acl</value> -->
        <property name="username" value="sa"/>
        <property name="password" value=""/>
    </bean>

    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <property name="dataSource" ref="dataSource"/>
    </bean>

    <tx:annotation-driven transaction-manager="transactionManager" />

    <bean id="dataSourcePopulator" class="sample.contact.DataSourcePopulator">
        <property name="dataSource" ref="dataSource"/>
        <property name="mutableAclService" ref="aclService"/>
        <property name="platformTransactionManager" ref="transactionManager"/>
    </bean>

    <bean id="contactManager" class="sample.contact.ContactManagerBackend">
       <property name="contactDao">
            <bean class="sample.contact.ContactDaoSpring">
               <property name="dataSource" ref="dataSource"/>
            </bean>
        </property>
        <property name="mutableAclService" ref="aclService"/>
   </bean>

</beans>
