public interface CacheWithLifetimes<K,V> extends Cache<K,V>
Modifier and Type | Method and Description |
---|---|
CacheEntry<V> |
getCacheEntry(K key)
Look up a CacheEntry in the cache.
|
void |
put(K key,
V value,
long lifetime)
Cache a key-value pair.
|
void |
putAll(java.util.Map<K,V> map,
long lifetime)
Cache one or more key-value pairs.
|
void put(K key, V value, long lifetime)
key
- key associated with valuevalue
- value associated with keylifetime
- lifetime in milliseconds associated with datavoid putAll(java.util.Map<K,V> map, long lifetime)
map
- map containing key-value pairs to cachelifetime
- lifetime in milliseconds associated with each key-value pair.
If the system supports revalidation of expired cache entries to determine if
expired entries are really obsolete, a value <= 0
indicates cached
entry should always be revalidated before being returned to clientCacheEntry<V> getCacheEntry(K key)
key
- key corresponding to valuenull
if key is not
in cache