org.javalite.activejdbc.cache
Class CacheManager

java.lang.Object
  extended by org.javalite.activejdbc.cache.CacheManager
Direct Known Subclasses:
EHCacheManager, OSCacheManager

public abstract class CacheManager
extends Object

Abstract method to be sub-classed by various caching technologies.

Author:
Igor Polevoy

Constructor Summary
CacheManager()
           
 
Method Summary
abstract  void addCache(String group, String key, Object cache)
          Adds item to cache.
 void addCacheEventListener(CacheEventListener listener)
           
abstract  void doFlush(CacheEvent event)
           
 void flush(CacheEvent event)
          Flash cache.
abstract  Object getCache(String group, String key)
          Returns a cached item.
 void removeAllCacheEventListeners()
           
 void removeCacheEventListener(CacheEventListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager()
Method Detail

getCache

public abstract Object getCache(String group,
                                String key)
Returns a cached item. Can return null if not found.

Parameters:
group - group of caches - this is a name of a table for which query results are cached
key - key of the item.
Returns:
a cached item. Can return null if not found.

addCache

public abstract void addCache(String group,
                              String key,
                              Object cache)
Adds item to cache.

Parameters:
group - group name of cache.
key - key of the item.
cache - cache item to add to cache.

doFlush

public abstract void doFlush(CacheEvent event)

flush

public final void flush(CacheEvent event)
Flash cache.

Parameters:
event - type of caches to flush.

addCacheEventListener

public final void addCacheEventListener(CacheEventListener listener)

removeCacheEventListener

public final void removeCacheEventListener(CacheEventListener listener)

removeAllCacheEventListeners

public final void removeAllCacheEventListeners()


Copyright © 2015 JavaLite. All rights reserved.