Class FifoCacheController
java.lang.Object
com.ibatis.sqlmap.engine.cache.fifo.FifoCacheController
- All Implemented Interfaces:
CacheController
FIFO (first in, first out) cache controller implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush(CacheModel cacheModel) Flushes the cache.intGets the cache size.getObject(CacheModel cacheModel, Object key) Get an object out of the cache.voidputObject(CacheModel cacheModel, Object key, Object value) Add an object to the cacheremoveObject(CacheModel cacheModel, Object key) Remove an object from a cache model.voidsetCacheSize(int cacheSize) Sets the cache size.voidsetProperties(Properties props) Configures the cache
-
Constructor Details
-
FifoCacheController
public FifoCacheController()Default constructor.
-
-
Method Details
-
getCacheSize
public int getCacheSize()Gets the cache size.- Returns:
- the cache size
-
setCacheSize
public void setCacheSize(int cacheSize) Sets the cache size.- Parameters:
cacheSize- the new cache size
-
setProperties
Configures the cache- Specified by:
setPropertiesin interfaceCacheController- Parameters:
props- Optionally can contain properties [reference-type=WEAK|SOFT|STRONG]
-
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
-