Interface CacheLoader<K,​V>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      V load​(K key)
      Cache loaders implement this method and return a non-null value on success.
    • Method Detail

      • load

        V load​(K key)
        throws PermanentLoadException,
               Exception
        Cache loaders implement this method and return a non-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.

        Parameters:
        key - key for the value to load. Always non-null
        Returns:
        non-null value on success or null if it could not find a value.
        Throws:
        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 value