|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.cache.impl.MemoryCacheStrategy<K,V>
public class MemoryCacheStrategy<K,V>
Default CacheStrategy implementation using a Map to store values
in memory.
Memory caches are thread-safe in all operations.
| Field Summary | |
|---|---|
static String |
ALIAS
Aliased used by provider for this implementation |
| Constructor Summary | |
|---|---|
MemoryCacheStrategy()
Default constructor. |
|
MemoryCacheStrategy(Map<K,V> cacheHolder)
Constructs a new MemoryCacheStrategy and sets the Map that will be
used as memory cache. |
|
| Method Summary | |
|---|---|
void |
clear()
Clear all cache contents. |
void |
destroy()
Perform the clean up. |
V |
get(K key)
Restore a value from the cache. |
void |
put(K key,
V value)
Put a value in the cache using a key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ALIAS
| Constructor Detail |
|---|
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.| Method Detail |
|---|
public V get(K key)
get in interface CacheStrategy<K,V>key - Object
public 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>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||