net.sf.swarmcache
Class CacheFactory

java.lang.Object
  |
  +--net.sf.swarmcache.CacheFactory

public class CacheFactory
extends java.lang.Object

A convenient generator of multicast caches using an underlying LRU or Automatic algorithm.

Author:
John Watkinson, Rajeev Kaul

Constructor Summary
protected CacheFactory()
           
  CacheFactory(CacheConfiguration conf)
           
 
Method Summary
 ObjectCache createCache(java.lang.String name)
          Creates a new cache.
 MultiCacheManager getCacheManager()
          Returns the manager that handles inter-cache communication.
 void shutdown()
          CacheFactory lifecycle shutdown method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheFactory

protected CacheFactory()

CacheFactory

public CacheFactory(CacheConfiguration conf)
Method Detail

createCache

public ObjectCache createCache(java.lang.String name)
Creates a new cache.

Parameters:
name - a name for the cache. Useful if there will be multiple caches for various objects.
Returns:
a new cache of either the LRU or AUTO underlying type, based on configuration.

getCacheManager

public MultiCacheManager getCacheManager()
Returns the manager that handles inter-cache communication.


shutdown

public void shutdown()
CacheFactory lifecycle shutdown method. This method should be called before exiting an application. Otherwise, the application will not terminate.