com.ibatis.sqlmap.engine.cache.memory

Class MemoryCacheController

public class MemoryCacheController extends Object implements CacheController

Memory-based implementation of CacheController
Method Summary
voidflush(CacheModel cacheModel)
Flushes the cache.
ObjectgetObject(CacheModel cacheModel, Object key)
Get an object out of the cache.
MemoryCacheLevelgetReferenceType()
voidputObject(CacheModel cacheModel, Object key, Object value)
Add an object to the cache
ObjectremoveObject(CacheModel cacheModel, Object key)
voidsetProperties(Properties props)
Configures the cache
voidsetReferenceType(MemoryCacheLevel referenceType)

Method Detail

flush

public void flush(CacheModel cacheModel)
Flushes the cache.

Parameters: cacheModel The cache model

getObject

public Object getObject(CacheModel cacheModel, Object key)
Get an object out of the cache.

Parameters: cacheModel The cache model key The key of the object to be returned

Returns: The cached object (or null)

getReferenceType

public MemoryCacheLevel getReferenceType()

putObject

public void putObject(CacheModel cacheModel, Object key, Object value)
Add an object to the cache

Parameters: cacheModel The cacheModel key The key of the object to be cached value The object to be cached

removeObject

public Object removeObject(CacheModel cacheModel, Object key)

setProperties

public void setProperties(Properties props)
Configures the cache

Parameters: props Optionally can contain properties [reference-type=WEAK|SOFT|STRONG]

setReferenceType

public void setReferenceType(MemoryCacheLevel referenceType)
Copyright © 2011. All Rights Reserved.