@AlfrescoPublicApi
public interface SimpleCache
All implementations must be thread-safe. Additionally, the use of the Serializable for both keys and values ensures that the underlying cache implementations can support both clustered caches as well as persistent caches.
All implementations must support null values. It therefore follows that
(simpleCache.contains(key) == true) does not imply (simpleCache.get(key) != null)but
(simpleCache.contains(key) == false) implies (simpleCache.get(key) == null)
Modifier and Type | Method and Description |
---|---|
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.
|
boolean contains(java.io.Serializable key)
key
- the cache key to check up onjava.util.Collection getKeys()
java.lang.Object get(java.io.Serializable key)
key
- void put(java.io.Serializable key, java.lang.Object value)
key
- the key against which to store the valuevalue
- the value to store. null is allowed.void remove(java.io.Serializable key)
key
- the key value to removevoid clear()
Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.