Interface CacheWriter<K,​V>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete​(K key)
      Called when a mapping is removed from the cache.
      void write​(K key, V value)
      Called when the value was updated or inserted into the cache.
    • Method Detail

      • write

        void write​(K key,
                   V value)
            throws Exception
        Called when the value was updated or inserted into the cache.

        Calling cache operations: It is illegal to call any cache methods from this method. This may have an undesired effect and can cause a deadlock.

        Parameters:
        key - key of the value to be written, never null.
        value - the value to be written, may be null if null is permitted.
        Throws:
        Exception - if an exception occurs, the cache update will not occur and this exception will be wrapped in a CacheWriterException
      • delete

        void delete​(K key)
             throws Exception
        Called when a mapping is removed from the cache. The removal was done by Cache.remove(K) or Cache.removeAll(). An expiry does not trigger a call to this method.
        Parameters:
        key - key of the value removed from the cache, never null.
        Throws:
        Exception - if an exception occurs, the cache update will not occur and this exception will be wrapped in a CacheWriterException