com.jdon.controller.cache
Class CacheManager

java.lang.Object
  extended by com.jdon.controller.cache.CacheManager
All Implemented Interfaces:
org.picocontainer.Startable

public class CacheManager
extends java.lang.Object
implements Startable

Cacahe Managerment Pattern Client objects request objects from a CacheManager object by calling its fetchObject method. The argument to the fetchObject method is an CacheKey object that identifies the object to fetch. The fetchObject method works by first calling the Cache object’s fetchObject method. there is one CacheManager in jdon container, you can get it from the container, do not need create it.


Field Summary
static java.lang.String module
           
 
Constructor Summary
CacheManager(Cache cache)
           
 
Method Summary
 void clear()
           
 java.lang.Object fetchObject(StringKey key)
          从缓存中获得缓存
 Cache getCache()
           
 java.util.Map getCacheKeyMap()
           
 void putObect(StringKey key, java.lang.Object value)
          保存到缓存中
 void removeCache(java.lang.Object dataKey, CacheKeyFactory cacheKeyFactory)
          清除缓存中该dataKey的相关所有缓存数? 当该dataKey相关的数据增删改时,调用本方法?以便及时清除缓存?? dataKey是数据的ID,如ProductId , ItemId?
 void removeObect(StringKey key)
          清除缓存
 void setCache(Cache cache)
           
 void setCacheKeyMap(java.util.Map cacheKeyMap)
           
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

module

public static java.lang.String module
Constructor Detail

CacheManager

public CacheManager(Cache cache)
Method Detail

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

clear

public void clear()

fetchObject

public java.lang.Object fetchObject(StringKey key)
从缓存中获得缓存

Parameters:
cacheKey -
Returns:

putObect

public void putObect(StringKey key,
                     java.lang.Object value)
保存到缓存中

Parameters:
cacheKey -
value -

removeObect

public void removeObect(StringKey key)
清除缓存

Parameters:
cacheKey -

removeCache

public void removeCache(java.lang.Object dataKey,
                        CacheKeyFactory cacheKeyFactory)
清除缓存中该dataKey的相关所有缓存数? 当该dataKey相关的数据增删改时,调用本方法?以便及时清除缓存?? dataKey是数据的ID,如ProductId , ItemId?

Parameters:
dataKey -
formName -

getCacheKeyMap

public java.util.Map getCacheKeyMap()

setCacheKeyMap

public void setCacheKeyMap(java.util.Map cacheKeyMap)

getCache

public Cache getCache()

setCache

public void setCache(Cache cache)