Class MemoryCacheController

java.lang.Object
com.ibatis.sqlmap.engine.cache.memory.MemoryCacheController
All Implemented Interfaces:
CacheController

public class MemoryCacheController extends Object implements CacheController
Memory-based implementation of CacheController.
  • Constructor Details

    • MemoryCacheController

      public MemoryCacheController()
  • Method Details

    • setProperties

      public void setProperties(Properties props)
      Configures the cache
      Specified by:
      setProperties in interface CacheController
      Parameters:
      props - Optionally can contain properties [reference-type=WEAK|SOFT|STRONG]
    • getReferenceType

      public MemoryCacheLevel getReferenceType()
      Gets the reference type.
      Returns:
      the reference type
    • setReferenceType

      public void setReferenceType(MemoryCacheLevel referenceType)
      Sets the reference type.
      Parameters:
      referenceType - the new reference type
    • putObject

      public void putObject(CacheModel cacheModel, Object key, Object value)
      Add an object to the cache
      Specified by:
      putObject in interface CacheController
      Parameters:
      cacheModel - The cacheModel
      key - The key of the object to be cached
      value - The object to be cached
    • getObject

      public Object getObject(CacheModel cacheModel, Object key)
      Get an object out of the cache.
      Specified by:
      getObject in interface CacheController
      Parameters:
      cacheModel - The cache model
      key - The key of the object to be returned
      Returns:
      The cached object (or null)
    • removeObject

      public Object removeObject(CacheModel cacheModel, Object key)
      Description copied from interface: CacheController
      Remove an object from a cache model.
      Specified by:
      removeObject in interface CacheController
      Parameters:
      cacheModel - - the model to remove the object from
      key - - the key to the object
      Returns:
      the removed object(?)
    • flush

      public void flush(CacheModel cacheModel)
      Flushes the cache.
      Specified by:
      flush in interface CacheController
      Parameters:
      cacheModel - The cache model