org.alfresco.repo.cache
Class MemoryCache
java.lang.Object
org.alfresco.repo.cache.MemoryCache
- All Implemented Interfaces:
- SimpleCache
public class MemoryCache
- extends java.lang.Object
- implements SimpleCache
A cache backed by a simple HashMap.
Note: This cache is not transaction- or thread-safe. Use it for single-threaded tests only.
- Since:
- 3.2
|
Method Summary |
void |
clear()
|
boolean |
contains(java.io.Serializable key)
|
java.lang.Object |
get(java.io.Serializable key)
|
java.util.Collection |
getKeys()
|
void |
put(java.io.Serializable key,
java.lang.Object value)
|
void |
remove(java.io.Serializable key)
Removes the cache entry whether or not the value stored against it is null. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MemoryCache
public MemoryCache()
contains
public boolean contains(java.io.Serializable key)
- Specified by:
contains in interface SimpleCache
- Parameters:
key - the cache key to check up on
- Returns:
- Returns true if there is a cache entry,
regardless of whether the value itself is null
getKeys
public java.util.Collection getKeys()
- Specified by:
getKeys in interface SimpleCache
get
public java.lang.Object get(java.io.Serializable key)
- Specified by:
get in interface SimpleCache
- Returns:
- Returns the value associated with the key. It will be null
if the value is null or if the cache doesn't have an entry.
put
public void put(java.io.Serializable key,
java.lang.Object value)
- Specified by:
put in interface SimpleCache
- Parameters:
key - the key against which to store the valuevalue - the value to store. null is allowed.
remove
public void remove(java.io.Serializable key)
- Description copied from interface:
SimpleCache
- Removes the cache entry whether or not the value stored against it is null.
- Specified by:
remove in interface SimpleCache
- Parameters:
key - the key value to remove
clear
public void clear()
- Specified by:
clear in interface SimpleCache
Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.