org.castor.cache
Class AbstractCacheFactory<K,V>
java.lang.Object
org.castor.cache.AbstractCacheFactory<K,V>
- Type Parameters:
K - the type of keys maintained by this cacheV - the type of cached values
- All Implemented Interfaces:
- CacheFactory<K,V>
- Direct Known Subclasses:
- CoherenceCacheFactory, CountLimitedFactory, EHCacheFactory, FIFOHashbeltFactory, FKCacheFactory, GigaspacesCacheFactory, JCacheFactory, JcsCacheFactory, LRUHashbeltFactory, NoCacheFactory, TimeLimitedFactory, UnlimitedFactory
public abstract class AbstractCacheFactory<K,V>
- extends Object
- implements CacheFactory<K,V>
Base implementation of CacheFactory. Users interested in supplying their
own cache implementations might want to extend this class to provide their
own CacheFactory instance.
- Since:
- 1.0
- Version:
- $Revision: 9041 $ $Date: 2011-08-16 11:51:17 +0200 (Di, 16 Aug 2011) $
- Author:
- Werner Guttmann, Ralf Joachim
|
Method Summary |
Cache<K,V> |
getCache(ClassLoader classLoader)
Instantiates an instance of the cache implementation this factory is responsible
for using the given classloader. |
protected boolean |
isInitialized()
Has the cache factory been initialized? |
void |
shutdown()
Allows for cache-specific shutdown operations and resource cleanup. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractCacheFactory
public AbstractCacheFactory()
isInitialized
protected final boolean isInitialized()
- Has the cache factory been initialized?
- Returns:
true if cache factory has been initialized,
false otherwise.
getCache
public final Cache<K,V> getCache(ClassLoader classLoader)
throws CacheAcquireException
- Instantiates an instance of the cache implementation this factory is responsible
for using the given classloader.
- Specified by:
getCache in interface CacheFactory<K,V>
- Parameters:
classLoader - A ClassLoader instance.
- Returns:
- A Cache instance.
- Throws:
CacheAcquireException - Problem instantiating a cache instance.
shutdown
public void shutdown()
- Allows for cache-specific shutdown operations and resource cleanup.
- Specified by:
shutdown in interface CacheFactory<K,V>
Copyright © 2012. All Rights Reserved.