Class 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 Detail

      • CacheAdapter

        public CacheAdapter()
    • 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 object
        object - the object that is to be cached