org.exolab.castor.persist.cache
Class CacheRegistry

java.lang.Object
  extended by org.exolab.castor.persist.cache.CacheRegistry

public final class CacheRegistry
extends java.lang.Object

Registry for CacheFactory implementations obtained from the Castor properties file and used by the JDO mapping configuration file.

Version:
$Id: CacheRegistry.java,v 1.7 2005/08/04 07:31:15 wguttmn Exp $
Author:
Bruce Snyder, Werner Guttmann

Method Summary
static Cache getCache(java.lang.String cacheType, int capacity, java.lang.String className, java.lang.ClassLoader classLoader)
          Returns a CacheFactory with the specified name.
static java.util.Collection getCacheFactories()
          Returns a collection of the current configured cache factories.
static java.lang.String[] getCacheFactoriesNames()
          Returns the names of all the configured Cache instances as a String array.
static java.util.Collection getCacheNames()
          Returns the names of all the configured Cache instances as a Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCache

public static Cache getCache(java.lang.String cacheType,
                             int capacity,
                             java.lang.String className,
                             java.lang.ClassLoader classLoader)
                      throws CacheAcquireException
Returns a CacheFactory with the specified name. The factory class names are loaded from the Castor properties file. Returns null if the named factory is not supported.

Parameters:
cacheType - Cache type identifier
capacity - Cache capacity.
className - Class name.
classLoader - A ClassLoader instance.
Returns:
A Cache instance, null if no cache type with this name exists.
Throws:
CacheAcquireException - A cache of the type specified can not be acquired.

getCacheFactoriesNames

public static java.lang.String[] getCacheFactoriesNames()
Returns the names of all the configured Cache instances as a String array. The names can be used to obtain a Cache from getCache(java.lang.String, int, java.lang.String, java.lang.ClassLoader).

Returns:
Names of the configured Cache implementations.

getCacheFactories

public static java.util.Collection getCacheFactories()
Returns a collection of the current configured cache factories.

Returns:
Collection of the current configured cache factories.

getCacheNames

public static java.util.Collection getCacheNames()
Returns the names of all the configured Cache instances as a Collection. The names can be used to obtain a Cache from getCache(java.lang.String, int, java.lang.String, java.lang.ClassLoader).

Returns:
Names of the configured Cache implementations.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com