|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CacheLoader
Extends JCache CacheLoader with load methods that take an argument in addition to a key This interface has exactly the same interface as in the JCache module.
Method Summary | |
---|---|
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. |
String |
getName()
Gets the name of a CacheLoader |
Status |
getStatus()
|
void |
init()
Notifies providers to initialise themselves. |
Object |
load(Object key)
loads an object. |
Object |
load(Object key,
Object argument)
Load using both a key and an argument. |
Map |
loadAll(Collection keys)
loads multiple object. |
Map |
loadAll(Collection keys,
Object argument)
Load using both a key and an argument. |
Method Detail |
---|
Object load(Object key) throws CacheException
key
- the key identifying the object being loaded
CacheException
Map loadAll(Collection keys)
keys
- a Collection of keys identifying the objects to be loaded
CacheException
Object load(Object key, Object argument)
JCache will call through to the load(key) method, rather than this method, where the argument is null.
key
- the key to load the object forargument
- can be anything that makes sense to the loader
CacheException
Map loadAll(Collection keys, Object argument)
JCache will use the loadAll(key) method where the argument is null.
keys
- the keys to load objects forargument
- can be anything that makes sense to the loader
CacheException
String getName()
CacheLoader clone(Ehcache cache) throws CloneNotSupportedException
Implementations should throw CloneNotSupportedException if they do not support clone but that will stop them from being used with defaultCache.
CloneNotSupportedException
- if the extension could not be cloned.void init()
This method is called during the Cache's initialise method after it has changed it's status to alive. Cache operations are legal in this method.
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()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |