public class CacheWrapperImpl extends java.lang.Object implements CacheWrapper
Initial Date: 03.10.2007
限定符和类型 | 方法和说明 |
---|---|
java.io.Serializable |
get(java.lang.String key) |
CacheWrapper |
getOrCreateChildCacheWrapper(OLATResourceable ores)
this method is thread safe. creates a child cachewrapper that represents the cachewrapper for the given olatresourceable within this parent cachewrapper(the 'this'
object)
|
void |
put(java.lang.String key,
java.io.Serializable value)
use this put whenever you just fill up a cache from data which is already on the db or the filesystem. e.g. use it when you simply load some properties again into
cache. e.g.
|
void |
remove(java.lang.String key)
removes a value from the cache. this method is thread-safe
|
void |
update(java.lang.String key,
java.io.Serializable value)
o_clusterREVIEW :pb review references puts a value in the cache. this method is thread-safe
Use this method if you generate new data (or change existing data) that cannot be known to other nodes yet. |
void |
updateMulti(java.lang.String[] keys,
java.io.Serializable[] values)
puts several values at once into the cache. same as repeatably calling put(key, value), but more efficient. please use in favor of put if applicable.
|
public CacheWrapper getOrCreateChildCacheWrapper(OLATResourceable ores)
CacheWrapper
getOrCreateChildCacheWrapper
在接口中 CacheWrapper
ores
- the olat resourceablepublic java.io.Serializable get(java.lang.String key)
get
在接口中 CacheWrapper
key
- the cache for the cache entrypublic void remove(java.lang.String key)
CacheWrapper
remove
在接口中 CacheWrapper
public void update(java.lang.String key, java.io.Serializable value)
CacheWrapper
update
在接口中 CacheWrapper
public void put(java.lang.String key, java.io.Serializable value)
CacheWrapper
CacheWrapper cw = aCache.getOrCreateChildCacheWrapper(ores); synchronized(cw) { String data = (String) cw.get(FULLUSERSET); if (data == null) { // cache entry has expired or has never been stored yet into the cache. // or has been invalidated in cluster mode data = loadDataFromDiskWeDidNotChangeAnythingButSimplyNeedTheDataAgain(...); cw.putSilent(FULLUSERSET, data); } return data; }
put
在接口中 CacheWrapper
public void updateMulti(java.lang.String[] keys, java.io.Serializable[] values)
CacheWrapper
updateMulti
在接口中 CacheWrapper
keys
- the array of keysvalues
- the array of values