public class MemoryCacheStrategy<K,V> extends Object implements CacheStrategy<K,V>
Map to store values
in memory.
Memory caches are thread-safe in all operations.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALIAS
Aliased used by provider for this implementation
|
| Constructor and Description |
|---|
MemoryCacheStrategy()
Default constructor.
|
MemoryCacheStrategy(Map<K,V> cacheHolder)
Constructs a new
MemoryCacheStrategy and sets the Map that will be
used as memory cache. |
public static final String ALIAS
public MemoryCacheStrategy()
HashMap as memory cache.public MemoryCacheStrategy(Map<K,V> cacheHolder)
MemoryCacheStrategy and sets the Map that will be
used as memory cache.cacheHolder - Map to use as memory cache. It cannot be null.public V get(K key)
get in interface CacheStrategy<K,V>key - Objectpublic void put(K key, V value)
put in interface CacheStrategy<K,V>key - Object.value - Object.public void clear()
clear in interface CacheStrategy<K,V>public void destroy()
destroy in interface CacheStrategy<K,V>Copyright © 2008-2013. All Rights Reserved.