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 TypeMethodDescriptionvoid
flush
(CacheModel cacheModel) Flushes the cache.getObject
(CacheModel cacheModel, Object key) Get an object out of the cache.Gets the reference type.void
putObject
(CacheModel cacheModel, Object key, Object value) Add an object to the cacheremoveObject
(CacheModel cacheModel, Object key) Remove an object from a cache model.void
setProperties
(Properties props) Configures the cachevoid
setReferenceType
(MemoryCacheLevel referenceType) Sets the reference type.
-
Constructor Details
-
MemoryCacheController
public MemoryCacheController()
-
-
Method Details
-
setProperties
Configures the cache- Specified by:
setProperties
in 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:
putObject
in 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:
getObject
in 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:CacheController
Remove an object from a cache model.- Specified by:
removeObject
in 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:
flush
in interfaceCacheController
- Parameters:
cacheModel
- The cache model
-