org.exolab.castor.persist.cache

Class CacheRegistry

public final class CacheRegistry extends 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 CachegetCache(String cacheType, int capacity, String className, ClassLoader classLoader)
Returns a CacheFactory with the specified name.
static CollectiongetCacheFactories()
Returns a collection of the current configured cache factories.
static String[]getCacheFactoriesNames()
Returns the names of all the configured Cache instances as a String array.
static CollectiongetCacheNames()
Returns the names of all the configured Cache instances as a Collection.

Method Detail

getCache

public static Cache getCache(String cacheType, int capacity, String className, ClassLoader classLoader)
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.

getCacheFactories

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

Returns: Collection of the current configured cache factories.

getCacheFactoriesNames

public static 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 CacheRegistry.

Returns: Names of the configured Cache implementations.

getCacheNames

public static Collection getCacheNames()
Returns the names of all the configured Cache instances as a Collection. The names can be used to obtain a Cache from CacheRegistry.

Returns: Names of the configured Cache implementations.

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