Class InMemoryCache
java.lang.Object
org.silverpeas.kernel.cache.model.AbstractSimpleCache
org.silverpeas.kernel.cache.service.InMemoryCache
- All Implemented Interfaces:
SimpleCache
Cache with which the data are stored in memory.
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.silverpeas.kernel.cache.model.AbstractSimpleCache
add, computeIfAbsent, getMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.silverpeas.kernel.cache.model.SimpleCache
has
-
Constructor Details
-
InMemoryCache
public InMemoryCache()
-
-
Method Details
-
getAll
Gets the cache.- Specified by:
getAllin classAbstractSimpleCache- Returns:
- the underlying cache used for its implementation.
-
clear
public void clear()Description copied from interface:SimpleCacheClear the content of the cache. -
get
Description copied from interface:SimpleCacheGets an element from the cache.- Parameters:
key- the key with which the object to get is mapped in the cache.- Returns:
- the object mapped with the key or null if no there is no object mapped with the specified key.
-
remove
Description copied from interface:SimpleCacheRemoves an element from the cache and return it.- Parameters:
key- the key with which the object to get is mapped in the cache.- Returns:
- the object removed from the cache.
-
remove
Description copied from interface:SimpleCacheRemoves a typed element from the cache and return it. Null is returned if an element exists for the given key but the object type doesn't correspond.- Type Parameters:
T- the concrete type of the object to remove.- Parameters:
key- the key with which the object to get is mapped in the cache.classType- the class of the instance to remove.- Returns:
- the object removed from the cache.
-
put
Description copied from interface:SimpleCachePuts a value for a given key. After 12 hours without be used the value is trashed.- Parameters:
key- the key with which the object to put has to be mappedvalue- the object to put in the cache.
-