com.jdon.model.query.cache
Class BlockCacheManager

java.lang.Object
  extended by com.jdon.controller.cache.CacheKeyFactory
      extended by com.jdon.model.query.cache.BlockCacheManager

public class BlockCacheManager
extends CacheKeyFactory

query block manager. batch query will get a collection result that it is a block, this block will be cached, next time, we lookup the result in the block that existed in cache, maybe in the block there are those promary keys collection, so reducing visiting database. the block is made of the primary keys of all models.


Field Summary
static java.lang.String CACHE_TYPE_BLOCK
           
 
Fields inherited from class com.jdon.controller.cache.CacheKeyFactory
module
 
Constructor Summary
BlockCacheManager(CacheManager cacheManager)
           
 
Method Summary
 void clearCache()
           
 CacheKey createCacheKeyImp(java.lang.Object dataKey, java.lang.String typeName)
           
 java.lang.Integer getAllCountsFromCache(QueryConditonDatakey qckey)
           
 java.util.List getBlockKeysFromCache(QueryConditonDatakey qckey)
           
 CacheKey getCacheKey(QueryConditonDatakey qckey)
           
 void saveAllCounts(QueryConditonDatakey qckey, java.lang.Integer allCount)
           
 void saveBlockKeys(QueryConditonDatakey qckey, java.util.List keys)
           
 
Methods inherited from class com.jdon.controller.cache.CacheKeyFactory
createCacheKey, getAllCacheKey, removeCacheKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_TYPE_BLOCK

public static final java.lang.String CACHE_TYPE_BLOCK
See Also:
Constant Field Values
Constructor Detail

BlockCacheManager

public BlockCacheManager(CacheManager cacheManager)
Method Detail

getBlockKeysFromCache

public java.util.List getBlockKeysFromCache(QueryConditonDatakey qckey)

getCacheKey

public CacheKey getCacheKey(QueryConditonDatakey qckey)

saveBlockKeys

public void saveBlockKeys(QueryConditonDatakey qckey,
                          java.util.List keys)

getAllCountsFromCache

public java.lang.Integer getAllCountsFromCache(QueryConditonDatakey qckey)

saveAllCounts

public void saveAllCounts(QueryConditonDatakey qckey,
                          java.lang.Integer allCount)

createCacheKeyImp

public CacheKey createCacheKeyImp(java.lang.Object dataKey,
                                  java.lang.String typeName)
Specified by:
createCacheKeyImp in class CacheKeyFactory

clearCache

public void clearCache()