com.compoundtheory.objectcache
Interface ICacheManager

All Known Implementing Classes:
CacheManager, DummyCacheManager

public interface ICacheManager


Method Summary
 void add(java.lang.String clazz, java.lang.String key, java.lang.ref.SoftReference softRef)
          Adds an object to to the cache
 void discard(java.lang.String clazz, java.lang.String key)
          Discard the object from the cache
 java.lang.Object get(java.lang.String clazz, java.lang.String key)
          Retrieve a CFC from the cache
 java.util.Set getCachedClasses()
          gets the set of classes that are stored in this cache
 boolean has(java.lang.String clazz, java.lang.String key)
          Whether the CFC has been cached
 java.lang.Object popReapedCFC(java.lang.ref.SoftReference softRef)
          remove a soft reference cleared object from the map so it can be fired for a discard queue
 void reap(java.lang.String clazz, java.lang.ref.SoftReference softRef)
          Reap off a cleared soft reference
 

Method Detail

has

boolean has(java.lang.String clazz,
            java.lang.String key)
Whether the CFC has been cached

Parameters:
clazz - The class of CFC
key - The key the CFC is stored under
Returns:
If it exists in a cache

get

java.lang.Object get(java.lang.String clazz,
                     java.lang.String key)
                     throws ObjectNotFoundException
Retrieve a CFC from the cache

Parameters:
clazz - The clas of the CFC
key - The key it was stored under
Returns:
The CFC itself
Throws:
ObjectNotFoundException - if the object doesn't exist in the cache

add

void add(java.lang.String clazz,
         java.lang.String key,
         java.lang.ref.SoftReference softRef)
Adds an object to to the cache

Parameters:
clazz - The class of the object
key - The key of the object
softRef - The soft reference containing the CFC

discard

void discard(java.lang.String clazz,
             java.lang.String key)
Discard the object from the cache

Parameters:
clazz - the class of the object
key - the key to discard

reap

void reap(java.lang.String clazz,
          java.lang.ref.SoftReference softRef)
Reap off a cleared soft reference

Parameters:
clazz - the class to reap to
softRef - the soft reference to reap

popReapedCFC

java.lang.Object popReapedCFC(java.lang.ref.SoftReference softRef)
remove a soft reference cleared object from the map so it can be fired for a discard queue

Parameters:
softRef - the softreference to be cleared

getCachedClasses

java.util.Set getCachedClasses()
gets the set of classes that are stored in this cache

Returns:
Set of classnames that are stored in this cache.