Class MemoryCacheController
java.lang.Object
com.ibatis.sqlmap.engine.cache.memory.MemoryCacheController
- All Implemented Interfaces:
CacheController
Memory-based implementation of CacheController.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush(CacheModel cacheModel) Flushes the cache.getObject(CacheModel cacheModel, Object key) Get an object out of the cache.Gets the reference type.voidputObject(CacheModel cacheModel, Object key, Object value) Add an object to the cacheremoveObject(CacheModel cacheModel, Object key) Remove an object from a cache model.voidsetProperties(Properties props) Configures the cachevoidsetReferenceType(MemoryCacheLevel referenceType) Sets the reference type.
-
Constructor Details
-
MemoryCacheController
public MemoryCacheController()
-
-
Method Details
-
setProperties
Configures the cache- Specified by:
setPropertiesin interfaceCacheController- Parameters:
props- Optionally can contain properties [reference-type=WEAK|SOFT|STRONG]
-
getReferenceType
Gets the reference type.- Returns:
- the reference type
-
setReferenceType
Sets the reference type.- Parameters:
referenceType- the new reference type
-
putObject
Add an object to the cache- Specified by:
putObjectin interfaceCacheController- Parameters:
cacheModel- The cacheModelkey- The key of the object to be cachedvalue- The object to be cached
-
getObject
Get an object out of the cache.- Specified by:
getObjectin interfaceCacheController- Parameters:
cacheModel- The cache modelkey- The key of the object to be returned- Returns:
- The cached object (or null)
-
removeObject
Description copied from interface:CacheControllerRemove an object from a cache model.- Specified by:
removeObjectin interfaceCacheController- Parameters:
cacheModel- - the model to remove the object fromkey- - the key to the object- Returns:
- the removed object(?)
-
flush
Flushes the cache.- Specified by:
flushin interfaceCacheController- Parameters:
cacheModel- The cache model
-