Memcached (10) simple-spring-memcached

Source: Internet
Author: User

Brief introduction

Simple-spring-memcached is an integrated use of spring and xmemcached. Use the cache in annotations.

Official address

Http://code.google.com/p/simple-spring-memcached/wiki/UserGuide

Note Notes

http://blog.csdn.net/a9529lty/article/details/8529432

Instructions for use

http://www.colorfuldays.org/tag/simple-spring-memcached/

Code Design Ideas

In the Userdao class, when adding or deleting changes, print out an action message to indicate that the code passed.

If there is a cache, the action is not printed.

In addition, the userdatabase simulates the behavior of the database, at the initial time, there is a id=1 record.

Introduction to Annotations

For entities, you need to annotate on the method @cachekeymethod indicates which key is used as the cache

For the DAO layer, the main requirements are 3 kinds of annotations

Add or update cache objects and persistence layers: @UpdateSingleCache (Namespace = "User", expiration = 3600)

Reads the cache and reads the persistence layer if the cache does not exist: @ReadThroughSingleCache (Namespace = "User", expiration = 0)

To delete data for the cache and Persistence layer: @InvalidateSingleCache (namespace = "User")

which

The @ParameterValueKeyProvider represents the key, and the Cachekeymethod class is labeled

@ParameterDataUpdateContent represents content

Other details are written in the code, and you can study and discuss them together.

Spring3.2.5-xmemcached-1.4.2_simple-spring.zip (9.3 KB)

From Iteye, Author: 85977328

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/tools/

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.