Ehcache Cache:
Interpretation:
The Ehcache cache is implemented on the basis of inheriting the spring cache core class CacheManager.
Common classes:
Ehcachecachemanager: Inherited from the CacheManager class (Org.springframework.cache.CacheManager) is responsible for managing the cache object.
Ehcachemanagerfactorybean: is a factory class that creates a new Ehcache CacheManager object based on the parameters set in the configuration file (the configuration file is injected into the factory class object ). It is possible to specify the path to the Ehcache configuration file used to create CacheManager through the property configlocation, usually the path of the Ehcache.xml file.
Instance:
------------------------------------------------------------------------------------------------------------
<!--cache configuration--
<!--enable the cache annotation feature-
<cache:annotation-driven cache-manager= "Cachemanger"/>
<bean id= "Cachemanagerfactory" class= "Org.springframework.cache.ehcache.EhCacheManagerFactoryBean" >
<property name= "configlocation" value= "Classpath:ehcache.xml" ></property>
</bean>
<bean id= "CacheManager" class= "Org.springframework.cache.ehcache.EhCacheCacheManager" >
<property name= "CacheManager" ref= "Cachemanagerfactory"/>
</bean>
------------------------------------------------------------------------------------------------------------
Service layer can be used to look at the http://www.cnblogs.com/zqsky/p/5868549.html.
Spring Cache Ehcache (Getting Started 2) source interpretation