K - type of the cache keyV - type of the cache valuepublic interface CacheLoader<K,V>
getWithLoader
or OHCache.getWithLoaderAsync(Object, CacheLoader) getWithLoaderAsynd}.| Modifier and Type | Method and Description |
|---|---|
V |
load(K key)
Cache loaders implement this method and return a non-
null value on success. |
V load(K key) throws PermanentLoadException, Exception
null value on success.
null can be returned to indicate that the no value for the requested key could be found.
Permanent failures in loading a specific key can be indicated by throwing a PermanentLoadException.
Other exceptions indicate a temporary failure.
key - key for the value to load. Always non-nullnull value on success or null if it could not find a value.PermanentLoadException - can be thrown by the loader implementation to indicate that
is will never succeed in finding a value for the requested key.Exception - any exception other than PermanentLoadException can be thrown by the
loader implementation to indicate a temporary failure in loading the valueCopyright © 2014–2021 Robert Stupp, Koeln, Germany, robert-stupp.de. All rights reserved.