com.ibatis.db.sqlmap.cache.memory
Class MemoryCacheController

java.lang.Object
  extended bycom.ibatis.db.sqlmap.cache.memory.MemoryCacheController
All Implemented Interfaces:
CacheController

public class MemoryCacheController
extends java.lang.Object
implements CacheController


Nested Class Summary
private static class MemoryCacheController.StrongReference
          Class to implement a strong (permanent) reference.
 
Field Summary
private  java.util.Map cache
           
private  MemoryCacheLevel cacheLevel
           
 
Constructor Summary
MemoryCacheController()
           
 
Method Summary
 void configure(java.util.Properties props)
          Configures the cache
 void flush(CacheModel cacheModel)
          Flushes the cache.
 java.lang.Object getObject(CacheModel cacheModel, java.lang.Object key)
          Get an object out of the cache.
 void putObject(CacheModel cacheModel, java.lang.Object key, java.lang.Object value)
          Add an object to the cache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheLevel

private MemoryCacheLevel cacheLevel

cache

private java.util.Map cache
Constructor Detail

MemoryCacheController

public MemoryCacheController()
Method Detail

configure

public void configure(java.util.Properties props)
Configures the cache

Specified by:
configure in interface CacheController
Parameters:
props - Optionally can contain properties [reference-type=WEAK|SOFT|STRONG]

putObject

public void putObject(CacheModel cacheModel,
                      java.lang.Object key,
                      java.lang.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 java.lang.Object getObject(CacheModel cacheModel,
                                  java.lang.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)

flush

public void flush(CacheModel cacheModel)
Flushes the cache.

Specified by:
flush in interface CacheController
Parameters:
cacheModel - The cache model