<?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="dir" class="java.io.File">
        <constructor-arg><value>${org.wamblee.photos.path}</value></constructor-arg>
    </bean>
    
    <bean id="cacheConfig" class="org.wamblee.io.ClassPathResource">
        <constructor-arg><value>ehcache.xml</value></constructor-arg>
    </bean>
    
    <bean id="authorizedPhotoCache" class="org.wamblee.cache.EhCache">
        <constructor-arg><ref local="cacheConfig"/></constructor-arg>
        <constructor-arg><value>photos</value></constructor-arg>
    </bean> 
    
    <bean id="photoCache" class="org.wamblee.cache.EhCache">
        <constructor-arg><ref local="cacheConfig"/></constructor-arg>
        <constructor-arg><value>photos</value></constructor-arg>
    </bean> 
    
    
    <bean id="fileSystemAlbum" 
        class="org.wamblee.photos.model.file.FileSystemAlbum">
        <constructor-arg><ref local="dir"/></constructor-arg>
        <constructor-arg><value>/</value></constructor-arg>
        <constructor-arg><ref local="photoCache"/></constructor-arg>
    </bean>
    
    <bean id="org.wamblee.photos.model.Album" 
        class="org.wamblee.photos.model.concurrency.ConcurrentAlbum">
        <constructor-arg><ref local="fileSystemAlbum"/></constructor-arg>        
    </bean>
   
    
</beans> 