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
ACacheAdapter
implementation 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 void
clearCache()
Clears the cache.void
putObjectIntoCache(int index, Object object)
Puts the object in the cache.Object
retrieveObjectFromCache(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:
clearCache
in classCacheAdapter
-
retrieveObjectFromCache
public Object retrieveObjectFromCache(int index)
Description copied from class:CacheAdapter
Retrieves the object from cache (if it's there).- Overrides:
retrieveObjectFromCache
in 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:CacheAdapter
Puts the object in the cache.- Overrides:
putObjectIntoCache
in classCacheAdapter
- Parameters:
index
- the index of the objectobject
- the object that is to be cached
-
-