org.tbee.cache.simple
Class CacheFactory

java.lang.Object
  extended by org.tbee.cache.simple.CacheFactory

public class CacheFactory
extends Object

This class keeps an eye on all created caches. Again using a WeakReference so it is cleaned out automatically if the actual user doesn't use it anymore.

You should use the factory if you want to be able to remove objects from all existing caches.

Version:
$Revision: 1.5 $
Author:
$Author: tom $

Field Summary
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
Constructor Summary
CacheFactory()
           
 
Method Summary
static void clearAllCaches()
          Clear all caches
static Cache newHashMapCache()
           
static Cache newHashMapCacheSoft()
           
static Cache newHashMapCacheWeak()
           
static Cache newLeastRecentlyUsedCache(int pSize)
           
static Cache newLeastRecentlyUsedCacheSoft(int pSize)
           
static Cache newLeastRecentlyUsedCacheWeak(int pSize)
           
static Cache newLifespanCache(int pLifespan)
           
static Cache newLifespanCacheSoft(int pLifespan)
           
static Cache newLifespanCacheWeak(int pLifespan)
           
static Cache newTimeoutCache(int pTimeout)
           
static Cache newTimeoutCacheSoft(int pTimeout)
           
static Cache newTimeoutCacheWeak(int pTimeout)
           
static void removeFromAllCaches(Object key)
          Remove a certain key from all caches
static void removeValueFromAllCaches(Object value)
          Remove a certain value from all caches
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values
Constructor Detail

CacheFactory

public CacheFactory()
Method Detail

newHashMapCache

public static Cache newHashMapCache()

newHashMapCacheSoft

public static Cache newHashMapCacheSoft()

newHashMapCacheWeak

public static Cache newHashMapCacheWeak()

newLeastRecentlyUsedCache

public static Cache newLeastRecentlyUsedCache(int pSize)

newLeastRecentlyUsedCacheSoft

public static Cache newLeastRecentlyUsedCacheSoft(int pSize)

newLeastRecentlyUsedCacheWeak

public static Cache newLeastRecentlyUsedCacheWeak(int pSize)

newLifespanCache

public static Cache newLifespanCache(int pLifespan)

newLifespanCacheSoft

public static Cache newLifespanCacheSoft(int pLifespan)

newLifespanCacheWeak

public static Cache newLifespanCacheWeak(int pLifespan)

newTimeoutCache

public static Cache newTimeoutCache(int pTimeout)

newTimeoutCacheSoft

public static Cache newTimeoutCacheSoft(int pTimeout)

newTimeoutCacheWeak

public static Cache newTimeoutCacheWeak(int pTimeout)

clearAllCaches

public static void clearAllCaches()
Clear all caches


removeFromAllCaches

public static void removeFromAllCaches(Object key)
Remove a certain key from all caches


removeValueFromAllCaches

public static void removeValueFromAllCaches(Object value)
Remove a certain value from all caches



Copyright © 2010 KnowledgePlaza. All Rights Reserved.