Package org.castor.cache
Class CacheFactoryRegistry
java.lang.Object
org.castor.cache.CacheFactoryRegistry
Registry for
CacheFactory
implementations obtained from the Castor
properties file and used by the JDO mapping configuration file.- Version:
- $Revision: 8102 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Bruce Snyder, Werner Guttmann, Ralf Joachim
-
Constructor Summary
ConstructorsConstructorDescriptionCacheFactoryRegistry
(AbstractProperties properties) Construct an instance of CacheFactoryRegistry that uses given properties to get required configuration properties. -
Method Summary
Modifier and TypeMethodDescriptiongetCache
(Properties props, ClassLoader classLoader) Returns aCache
instance with the specified properties.Returns a collection of the current configured cache factories.Returns a collection of the current configured cache factory names.
-
Constructor Details
-
CacheFactoryRegistry
Construct an instance of CacheFactoryRegistry that uses given properties to get required configuration properties.- Parameters:
properties
- The properties.
-
-
Method Details
-
getCache
Returns aCache
instance with the specified properties.The type of the returned cache is taken from the type property. If not specified a count-limited cache will be returned. If the type of the cache specified is unknown a CacheAcquireException will be thrown.
If the given properties contain a debug property set to true or if debugging for the selected cache type is enabled, the returned cache will be wrapped by a DebuggingCacheProxy. This proxy will output debug messages to the log if logging for the Cache interface is enabled through the logging system.
- Parameters:
props
- Properties to initialize the cache with.classLoader
- A ClassLoader instance.- Returns:
- A
Cache
instance. - Throws:
CacheAcquireException
- A cache of the type specified can not be acquired.
-
getCacheFactories
Returns a collection of the current configured cache factories.- Returns:
- Collection of the current configured cache factories.
-
getCacheNames
Returns a collection of the current configured cache factory names.- Returns:
- Names of the configured cache factories.
-