public interface CacheLoader<K,V> extends CacheCallback
Region.get(Object)is called for a region entry that has a
loadmethod of the region's cache loader is invoked. The
loadmethod creates the value for the desired key by performing an operation such as a database query. The
loadmay also perform a net search that will look for the value in a cache instance hosted by another member of the distributed system.
WARNING: To avoid risk of deadlock, do not invoke CacheFactory.getAnyInstance() from within any callback methods. Instead use LoaderHelper.getRegion().getCache().
|Modifier and Type||Method and Description|
Loads a value.
V load(LoaderHelper<K,V> helper) throws CacheLoaderException
Region.get(Object, Object)that triggered this load.
helper- a LoaderHelper object that is passed in from cache service and provides access to the key, region, argument, and
Region.get(Object, Object)to return
CacheLoaderException,- if an error occurs. This exception or any other exception thrown by this method will be propagated back to the application from the get method.