| 1 | package net.spy.memcached; |
| 2 | |
| 3 | /** |
| 4 | * A Map interface to memcached. |
| 5 | * |
| 6 | * <p> |
| 7 | * Do note that nothing that iterates over the map will work (such is |
| 8 | * memcached). All iteration mechanisms will return empty iterators and |
| 9 | * such. |
| 10 | * </p> |
| 11 | */ |
| 12 | public class CacheMap extends BaseCacheMap<Object> { |
| 13 | |
| 14 | /** |
| 15 | * Construct a CacheMap over the given MemcachedClient. |
| 16 | * |
| 17 | * @param c the client |
| 18 | * @param expiration the expiration to set for keys written to the cache |
| 19 | * @param prefix a prefix used to make keys in this map unique |
| 20 | */ |
| 21 | public CacheMap(MemcachedClientIF c, int expiration, String prefix) { |
| 22 | super(c, expiration, prefix, c.getTranscoder()); |
| 23 | } |
| 24 | |
| 25 | /** |
| 26 | * Construct a CacheMap over the given MemcachedClient with no expiration. |
| 27 | * |
| 28 | * <p> |
| 29 | * Keys written into this Map will only expire when the LRU pushes them |
| 30 | * out. |
| 31 | * </p> |
| 32 | * |
| 33 | * @param c the client |
| 34 | * @param prefix a prefix used to make keys in this map unique |
| 35 | */ |
| 36 | public CacheMap(MemcachedClientIF c, String prefix) { |
| 37 | this(c, 0, prefix); |
| 38 | } |
| 39 | |
| 40 | } |