net.fortuna.mstor.util
Class CacheAdapter

java.lang.Object
  extended by net.fortuna.mstor.util.CacheAdapter
Direct Known Subclasses:
EhCacheAdapter

public class CacheAdapter
extends java.lang.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
CacheAdapter()
           
 
Method Summary
 void clearCache()
          Clears the cache.
 void putObjectIntoCache(int index, java.lang.Object object)
          Puts the object in the cache.
 java.lang.Object retrieveObjectFromCache(int index)
          Retrieves the object from cache (if it's there).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheAdapter

public CacheAdapter()
Method Detail

clearCache

public void clearCache()
Clears the cache.


retrieveObjectFromCache

public java.lang.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,
                               java.lang.Object object)
Puts the object in the cache.

Parameters:
index - the index of the object
object - the object that is to be cached


Copyright © 2004-2011 Micronode. All Rights Reserved.