org.apache.jcs.auxiliary.disk.indexed
Class IndexedDiskCacheManager

java.lang.Object
  extended byorg.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheManager
All Implemented Interfaces:
AuxiliaryCacheManager, ICacheType, java.io.Serializable

public class IndexedDiskCacheManager
extends java.lang.Object
implements AuxiliaryCacheManager

Cache manager for IndexedDiskCaches.

Version:
$Id: IndexedDiskCacheManager.java,v 1.4 2003/08/22 11:57:17 mpoeschl Exp $
Author:
Aaron Smuts, James Taylor
See Also:
Serialized Form

Field Summary
private  java.util.Hashtable caches
           
private static int clients
           
private  IndexedDiskCacheAttributes defaultCacheAttributes
           
private static IndexedDiskCacheManager instance
           
private static org.apache.commons.logging.Log log
           
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
private IndexedDiskCacheManager(IndexedDiskCacheAttributes defaultCacheAttributes)
          Constructor for the IndexedDiskCacheManager object
 
Method Summary
 void freeCache(java.lang.String cacheName)
          Disposes the cache with the given name, if found in the set of managed caches.
 AuxiliaryCache getCache(IndexedDiskCacheAttributes cacheAttributes)
          Get an IndexedDiskCache for the supplied attributes.
 AuxiliaryCache getCache(java.lang.String cacheName)
          Gets an IndexedDiskCache for the supplied name using the default attributes.
 int getCacheType()
          Gets the cacheType attribute of the DiskCacheManager object
static IndexedDiskCacheManager getInstance(IndexedDiskCacheAttributes defaultCacheAttributes)
          Gets the singleton instance of the manager
 void release()
          Releases the cache manager instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.apache.commons.logging.Log log

clients

private static int clients

instance

private static IndexedDiskCacheManager instance

caches

private java.util.Hashtable caches

defaultCacheAttributes

private IndexedDiskCacheAttributes defaultCacheAttributes
Constructor Detail

IndexedDiskCacheManager

private IndexedDiskCacheManager(IndexedDiskCacheAttributes defaultCacheAttributes)
Constructor for the IndexedDiskCacheManager object

Parameters:
defaultCacheAttributes - Default attributes for caches managed by the instance.
Method Detail

getInstance

public static IndexedDiskCacheManager getInstance(IndexedDiskCacheAttributes defaultCacheAttributes)
Gets the singleton instance of the manager

Parameters:
defaultCacheAttributes - If the instance has not yet been created, it will be initialized with this set of default attributes.
Returns:
The instance value

getCache

public AuxiliaryCache getCache(java.lang.String cacheName)
Gets an IndexedDiskCache for the supplied name using the default attributes.

Specified by:
getCache in interface AuxiliaryCacheManager
Parameters:
cacheName - Name that will be used when creating attributes.
Returns:
A cache.
See Also:
#getCache( IndexedDiskCacheAttributes }

getCache

public AuxiliaryCache getCache(IndexedDiskCacheAttributes cacheAttributes)
Get an IndexedDiskCache for the supplied attributes. Will provide an existing cache for the name attribute if one has been created, or will create a new cache.

Parameters:
cacheAttributes - Attributes the cache should have.
Returns:
A cache, either from the existing set or newly created.

freeCache

public void freeCache(java.lang.String cacheName)
Disposes the cache with the given name, if found in the set of managed caches.

Parameters:
cacheName - Name of cache to dispose.

getCacheType

public int getCacheType()
Gets the cacheType attribute of the DiskCacheManager object

Specified by:
getCacheType in interface ICacheType
Returns:
The cacheType value

release

public void release()
Releases the cache manager instance. When all clients have released the cache manager, all contained caches will be disposed.