Package net.fortuna.mstor.util
Class CacheAdapter
- java.lang.Object
-
- net.fortuna.mstor.util.CacheAdapter
-
- Direct Known Subclasses:
EhCacheAdapter
public class CacheAdapter extends Object
A simple adapter for caching functionality. It can be used for example to cache messages for a single folder.. This class by itself is a stub that doesn't actually implement any caching. Subclasses of this class may implement various caching strategies though.
-
-
Constructor Summary
Constructors Constructor Description CacheAdapter()
-
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).
-
-
-
Method Detail
-
clearCache
public void clearCache()
Clears the cache.
-
retrieveObjectFromCache
public Object retrieveObjectFromCache(int index)
Retrieves the object from cache (if it's there).- 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)
Puts the object in the cache.- Parameters:
index
- the index of the objectobject
- the object that is to be cached
-
-