Spring Cache Ehcache (Getting Started 2) source interpretation

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.