com.compoundtheory.objectcache
Class DummyCacheManager

java.lang.Object
  extended by com.compoundtheory.objectcache.DummyCacheManager
All Implemented Interfaces:
ICacheManager

public class DummyCacheManager
extends java.lang.Object
implements ICacheManager

This is a dummy class that pretty much does nothing

Author:
Mark Mandel

Constructor Summary
DummyCacheManager(CacheConfig config)
          Constructor
 
Method Summary
 void add(java.lang.String clazz, java.lang.String key, java.lang.ref.SoftReference softRef)
          Goes nowhere
 void discard(java.lang.String clazz, java.lang.String key)
          Doesn't discard, as it holds nothings
 java.lang.Object get(java.lang.String clazz, java.lang.String key)
          Will always throw a ObjectNotFoundException
 java.util.Set getCachedClasses()
          returns an empty set
 boolean has(java.lang.String clazz, java.lang.String key)
          Never has anything
 java.lang.Object popReapedCFC(java.lang.ref.SoftReference softRef)
          returns null
 void reap(java.lang.String clazz, java.lang.ref.SoftReference softRef)
          Does nothing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyCacheManager

public DummyCacheManager(CacheConfig config)
Constructor

Parameters:
config - does nothing with this
Method Detail

add

public void add(java.lang.String clazz,
                java.lang.String key,
                java.lang.ref.SoftReference softRef)
Goes nowhere

Specified by:
add in interface ICacheManager
Parameters:
clazz - The class of the object
key - The key of the object
softRef - The soft reference containing the CFC

discard

public void discard(java.lang.String clazz,
                    java.lang.String key)
Doesn't discard, as it holds nothings

Specified by:
discard in interface ICacheManager
Parameters:
clazz - the class of the object
key - the key to discard

get

public java.lang.Object get(java.lang.String clazz,
                            java.lang.String key)
                     throws ObjectNotFoundException
Will always throw a ObjectNotFoundException

Specified by:
get in interface ICacheManager
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

has

public boolean has(java.lang.String clazz,
                   java.lang.String key)
Never has anything

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

reap

public void reap(java.lang.String clazz,
                 java.lang.ref.SoftReference softRef)
Does nothing

Specified by:
reap in interface ICacheManager
Parameters:
clazz - the class to reap to
softRef - the soft reference to reap

popReapedCFC

public java.lang.Object popReapedCFC(java.lang.ref.SoftReference softRef)
returns null

Specified by:
popReapedCFC in interface ICacheManager
Parameters:
softRef - the softreference to be cleared

getCachedClasses

public java.util.Set getCachedClasses()
returns an empty set

Specified by:
getCachedClasses in interface ICacheManager
Returns:
Set of classnames that are stored in this cache.