egovframework.rfc3.common.cache
Class EhCacheController

java.lang.Object
  extended by egovframework.rfc3.common.cache.EhCacheController
All Implemented Interfaces:
com.ibatis.sqlmap.engine.cache.CacheController

public class EhCacheController
extends java.lang.Object
implements com.ibatis.sqlmap.engine.cache.CacheController

EhCache Implementation of the CacheController interface to be able to use EhCache as a cache implementation in iBatis. You can configure your cache model as follows, by example, in your sqlMapping files: <cacheModel id="myCache" type="nl.rabobank.springproject.ibatis.EhCacheController" readOnly="true" serialize="false"> <property name="configFile" value="/path-to-ehcache.xml"/> </cacheModel> Alternatively, you can use a type alias in your type attribute and defining the class with a <TypeAlias> declaration, see iBatis documentation on how to do this.


Constructor Summary
EhCacheController()
           
 
Method Summary
 void finalize()
          Shut down the EH Cache CacheManager.
 void flush(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel)
          Flush a cache model.
 java.lang.Object getObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel, java.lang.Object key)
          Get an object from a cache model.
 void putObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel, java.lang.Object key, java.lang.Object object)
          Put an object into a cache model.
 java.lang.Object removeObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel, java.lang.Object key)
          Remove an object from a cache model.
 void setProperties(java.util.Properties props)
          Configure a cache controller.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhCacheController

public EhCacheController()
Method Detail

flush

public void flush(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel)
Flush a cache model.

Specified by:
flush in interface com.ibatis.sqlmap.engine.cache.CacheController
Parameters:
cacheModel - - the model to flush.

getObject

public java.lang.Object getObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel,
                                  java.lang.Object key)
Get an object from a cache model.

Specified by:
getObject in interface com.ibatis.sqlmap.engine.cache.CacheController
Parameters:
cacheModel - - the model.
key - - the key to the object.
Returns:
the object if in the cache, or null(?).

putObject

public void putObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel,
                      java.lang.Object key,
                      java.lang.Object object)
Put an object into a cache model.

Specified by:
putObject in interface com.ibatis.sqlmap.engine.cache.CacheController
Parameters:
cacheModel - - the model to add the object to.
key - - the key to the object.
object - - the object to add.

removeObject

public java.lang.Object removeObject(com.ibatis.sqlmap.engine.cache.CacheModel cacheModel,
                                     java.lang.Object key)
Remove an object from a cache model.

Specified by:
removeObject in interface com.ibatis.sqlmap.engine.cache.CacheController
Parameters:
cacheModel - - the model to remove the object from.
key - - the key to the object.
Returns:
the removed object(?).

setProperties

public void setProperties(java.util.Properties props)
Configure a cache controller. Initialize the EH Cache Manager as a singleton.

Specified by:
setProperties in interface com.ibatis.sqlmap.engine.cache.CacheController
Parameters:
props - - the properties object continaing configuration information.

finalize

public void finalize()
Shut down the EH Cache CacheManager.

Overrides:
finalize in class java.lang.Object