Interface CacheLoader<K,​V>

    • Method Detail

      • load

        V load​(LoaderHelper<K,​V> helper)
        throws CacheLoaderException
        Loads a value. Application writers should implement this method to customize the loading of a value. This method is called by the caching service when the requested value is not in the cache. Any exception (including an unchecked exception) thrown by this method is propagated back to and thrown by the invocation of Region.get(Object, Object) that triggered this load.

        Parameters:
        helper - a LoaderHelper object that is passed in from cache service and provides access to the key, region, argument, and netSearch.
        Returns:
        the value supplied for this key, or null if no value can be supplied. A local loader will always be invoked if one exists. Otherwise one remote loader is invoked. Returning null causes Region.get(Object, Object) to return null.
        Throws:
        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.
        See Also:
        Region.get