|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shiro.cache.AbstractCacheManager
public abstract class AbstractCacheManager
Very simple abstract CacheManager
implementation that retains all created Cache
instances in
an in-memory ConcurrentMap
. Cache
instance creation is left to subclasses via
the createCache
method implementation.
Constructor Summary | |
---|---|
AbstractCacheManager()
Default no-arg constructor that instantiates an internal name-to-cache ConcurrentMap . |
Method Summary | ||
---|---|---|
protected abstract Cache |
createCache(String name)
Creates a new Cache instance associated with the specified name . |
|
void |
destroy()
Cleanup method that first destroys all of it's managed caches and then
clears out the internally referenced cache map. |
|
|
getCache(String name)
Returns the cache with the specified name . |
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractCacheManager()
ConcurrentMap
.
Method Detail |
---|
public <K,V> Cache<K,V> getCache(String name) throws IllegalArgumentException, CacheException
name
. If the cache instance does not yet exist, it will be lazily
created, retained for further access, and then returned.
getCache
in interface CacheManager
name
- the name of the cache to acquire.
name
.
IllegalArgumentException
- if the name
argument is null
or does not contain text.
CacheException
- if there is a problem lazily creating a Cache
instance.protected abstract Cache createCache(String name) throws CacheException
Cache
instance associated with the specified name
.
name
- the name of the cache to create
Cache
instance associated with the specified name
.
CacheException
- if the Cache
instance cannot be created.public void destroy() throws Exception
destroys
all of it's managed caches and then
clears
out the internally referenced cache map.
destroy
in interface Destroyable
Exception
- if any of the managed caches can't destroy properly.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |