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)