<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
	xmlns:context="http://www.springframework.org/schema/context" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task"
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
   http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
   http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
   http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
   http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd
   http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring http://ehcache-spring-annotations.googlecode.com/svn/schema/ehcache-spring/ehcache-spring-1.2.xsd">


	<bean id="springCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
		<property name="configLocation" value="classpath:/ehcache/smcore-ehcache.xml" />
		<property name="shared" value="false" />
	</bean>

	<bean id="serviceCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
		<property name="cacheManager">
			<ref local="springCacheManager" />
		</property>
	</bean>

    <bean id="serviceCache" factory-bean="serviceCacheManager" factory-method="getCache">
        <constructor-arg value="com.shopizer.OBJECT_CACHE" />
    </bean>

    <!--Jhonny: added to monitor statistics-->
    <bean id="managementService" class="net.sf.ehcache.management.ManagementService"
          init-method="init"
          destroy-method="dispose">
        <constructor-arg ref="springCacheManager"/>
        <constructor-arg ref="mbeanServer"/>
        <constructor-arg index="2" value="false"/>
        <constructor-arg index="3" value="false"/>
        <constructor-arg index="4" value="false"/>
        <constructor-arg index="5" value="true"/>
    </bean>
    <bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
        <property name="locateExistingServerIfPossible" value="true"/>
    </bean>

</beans>