Package com.foxinmy.weixin4j.cache
Class MemcacheCacheStorager<T extends Cacheable>
- java.lang.Object
-
- com.foxinmy.weixin4j.cache.MemcacheCacheStorager<T>
-
- All Implemented Interfaces:
CacheStorager<T>
public class MemcacheCacheStorager<T extends Cacheable> extends Object implements CacheStorager<T>
用Memcache保存缓存对象(推荐使用)- Since:
- JDK 1.6
- Author:
- jinyu(foxinmy@gmail.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MemcacheCacheStorager.MemcachePoolConfig
-
Field Summary
-
Fields inherited from interface com.foxinmy.weixin4j.cache.CacheStorager
ALLKEY, CUTMS
-
-
Constructor Summary
Constructors Constructor Description MemcacheCacheStorager()
MemcacheCacheStorager(MemcacheCacheStorager.MemcachePoolConfig poolConfig)
-
-
-
Constructor Detail
-
MemcacheCacheStorager
public MemcacheCacheStorager()
-
MemcacheCacheStorager
public MemcacheCacheStorager(MemcacheCacheStorager.MemcachePoolConfig poolConfig)
-
-
Method Detail
-
lookup
public T lookup(String key)
Description copied from interface:CacheStorager
查找缓存中的对象- Specified by:
lookup
in interfaceCacheStorager<T extends Cacheable>
- Parameters:
key
- 缓存key- Returns:
- 缓存对象
-
caching
public void caching(String key, T cache)
Description copied from interface:CacheStorager
缓存新的对象- Specified by:
caching
in interfaceCacheStorager<T extends Cacheable>
- Parameters:
key
- 缓存keycache
- 将要缓存的对象
-
evict
public T evict(String key)
Description copied from interface:CacheStorager
移除缓存对象- Specified by:
evict
in interfaceCacheStorager<T extends Cacheable>
- Parameters:
key
- 缓存key- Returns:
- 移除的对象
-
clear
public void clear()
Description copied from interface:CacheStorager
清除所有缓存对象(请慎重)- Specified by:
clear
in interfaceCacheStorager<T extends Cacheable>
-
-