public interface CacheLoader
Modifier and Type | Method and Description |
---|---|
CacheLoader |
clone(Ehcache cache)
Creates a clone of this extension.
|
void |
dispose()
CacheLoader instances may be doing all sorts of exotic things and need to be able to clean up
on dispose.
|
java.lang.String |
getName()
Gets the name of a CacheLoader
|
Status |
getStatus() |
void |
init()
Notifies providers to initialise themselves.
|
java.lang.Object |
load(java.lang.Object key)
loads an object.
|
java.lang.Object |
load(java.lang.Object key,
java.lang.Object argument)
Load using both a key and an argument.
|
java.util.Map |
loadAll(java.util.Collection keys)
loads multiple object.
|
java.util.Map |
loadAll(java.util.Collection keys,
java.lang.Object argument)
Load using both a key and an argument.
|
java.lang.Object load(java.lang.Object key) throws CacheException
key
- the key identifying the object being loadedCacheException
java.util.Map loadAll(java.util.Collection keys)
keys
- a Collection of keys identifying the objects to be loadedCacheException
java.lang.Object load(java.lang.Object key, java.lang.Object argument)
key
- the key to load the object forargument
- can be anything that makes sense to the loaderCacheException
java.util.Map loadAll(java.util.Collection keys, java.lang.Object argument)
keys
- the keys to load objects forargument
- can be anything that makes sense to the loaderCacheException
java.lang.String getName()
CacheLoader clone(Ehcache cache) throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- if the extension could not be cloned.void init()
CacheException
Ehcache.registerCacheLoader(net.sf.ehcache.loader.CacheLoader)
void dispose() throws CacheException
Cache.dispose()
is invoked
if this CacheLoader is registered with the cache at disposal time, allowing for any necessary cleanup.
No operations may be performed on the cache this CacheLoader is registered with. The
cache itself is partly disposed when this method is called, and should not be accessed.
CacheException
Status getStatus()