Package net.fortuna.mstor.util
Class EhCacheAdapter
- java.lang.Object
-
- net.fortuna.mstor.util.CacheAdapter
-
- net.fortuna.mstor.util.EhCacheAdapter
-
public class EhCacheAdapter extends CacheAdapter
ACacheAdapterimplementation that uses the Ehcache library.
-
-
Constructor Summary
Constructors Constructor Description EhCacheAdapter(String cacheName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearCache()Clears the cache.voidputObjectIntoCache(int index, Object object)Puts the object in the cache.ObjectretrieveObjectFromCache(int index)Retrieves the object from cache (if it's there).
-
-
-
Constructor Detail
-
EhCacheAdapter
public EhCacheAdapter(String cacheName)
-
-
Method Detail
-
clearCache
public void clearCache()
Clears the cache.- Overrides:
clearCachein classCacheAdapter
-
retrieveObjectFromCache
public Object retrieveObjectFromCache(int index)
Description copied from class:CacheAdapterRetrieves the object from cache (if it's there).- Overrides:
retrieveObjectFromCachein classCacheAdapter- Parameters:
index- the index of the required object- Returns:
- the object, or null if the object with the given index is not in the cache
-
putObjectIntoCache
public void putObjectIntoCache(int index, Object object)Description copied from class:CacheAdapterPuts the object in the cache.- Overrides:
putObjectIntoCachein classCacheAdapter- Parameters:
index- the index of the objectobject- the object that is to be cached
-
-