ehcache

net.sf.ehcache.loader
Interface CacheLoader

All Superinterfaces:
net.sf.jsr107cache.CacheLoader

public interface CacheLoader
extends net.sf.jsr107cache.CacheLoader

Extends JCache CacheLoader with load methods that take an argument in addition to a key

Version:
$Id$
Author:
Greg Luck

Method Summary
 java.lang.String getName()
          Gets the name of a CacheLoader
 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, java.lang.Object argument)
          Load using both a key and an argument.
 
Methods inherited from interface net.sf.jsr107cache.CacheLoader
load, loadAll
 

Method Detail

load

java.lang.Object load(java.lang.Object key,
                      java.lang.Object argument)
                      throws net.sf.jsr107cache.CacheException
Load using both a key and an argument. JCache will call through to the load(key) method, rather than this method, where the argument is null.

Parameters:
key - the key to load the object for
argument - can be anything that makes sense to the loader
Returns:
the Object loaded
Throws:
net.sf.jsr107cache.CacheException

loadAll

java.util.Map loadAll(java.util.Collection keys,
                      java.lang.Object argument)
                      throws net.sf.jsr107cache.CacheException
Load using both a key and an argument. JCache will use the loadAll(key) method where the argument is null.

Parameters:
keys - the keys to load objects for
argument - can be anything that makes sense to the loader
Returns:
a map of Objects keyed by the collection of keys passed in.
Throws:
net.sf.jsr107cache.CacheException

getName

java.lang.String getName()
Gets the name of a CacheLoader

Returns:
the name of this CacheLoader

ehcache