Process records for Java clients upgraded to Couchbase by memcached (ii)

Source: Internet
Author: User
Tags couchbase

Shiro provides a spring-like cache abstraction that Shiro itself does not implement the cache, but the cache is abstracted to make it easy to replace different underlying cache Implementations.

Shiro Support for caching

Shiro does not implement caching capabilities, Shiro's caching support is just an abstract api. This abstraction is based on a product from a Multi-cache mechanism. In other words, Shiro can "sit on 3,000 concubine" ah.

Below are the contents of the Chinese translation of the Apache Shiro 1.2.x user guide:
The Shiro has three important cache interfaces:
Cachemanager-the Primary Management component responsible for all caches, which returns the cache Instance.
Cache-maintain Key/value Pairs.
Cachemanageraware-implemented by components that want to receive and use CacheManager Instances.
CacheManager returns the cache instance, and various Shiro components use these cache instances to buffer the necessary Data. Any Shiro component that implements the Cachemanageraware will automatically receive a configured CacheManager that can be used to obtain the Cache instance.

Some concepts for the cache can be found in the Spring cache abstraction: http://jinnianshilongnian.iteye.com/blog/2001040.

shiro-memcached

SOURCE Address: https://github.com/mythfish/shiro-memcached

Using memcached to implement Shiro caching

Note: memcached only supports stirng Types. This source uses xmemcached as the memcached Client.

Java Connection memcached has the following three ways:

1, the use of technical Memcached

2, the use of spymemcached

Source: https://github.com/couchbase/spymemcached

3, the use of xmemcached

Combined with the Actual:

After the code is incorporated into the project, start the project, log in to http://localhost:8091/, and view the documents for default in Databuckets. You can see that the data has been put into the cache

Process records for Java clients upgraded to Couchbase by memcached (ii)

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.