javax.cache
Interface CacheLoader<K,V>
- All Known Subinterfaces:
- CacheBacking<K,V>, CacheLoaderExt<K,V>
- All Known Implementing Classes:
- AbstractCacheBacking, CacheLoaderAdapter, JdbcCacheBacking
public interface CacheLoader<K,V>
Method Summary |
Cache.Entry<K,V> |
load(java.lang.Object key)
Obtains the value associated with the key, which will be loaded into the Cache |
java.util.Map<K,V> |
loadAll(java.lang.Iterable<? extends K> keys)
Creates a set of entries that will be loaded into the cache. |
load
Cache.Entry<K,V> load(java.lang.Object key)
- Obtains the value associated with the key, which will be loaded into the Cache
- Parameters:
key
- associated with the value.
- Returns:
- the value returned from the CacheLoader
- Throws:
CacheException
loadAll
java.util.Map<K,V> loadAll(java.lang.Iterable<? extends K> keys)
- Creates a set of entries that will be loaded into the cache.
- Parameters:
keys
- the collection of keys
- Returns:
- a map of key-value pairs that will be loaded into the cache.
- Throws:
CacheException