Interface CacheStorage

All Known Subinterfaces:
ConcurrentCacheStorage
All Known Implementing Classes:
MruCacheStorage, SoftCacheStorage, StrongCacheStorage

public interface CacheStorage
Cache storage abstracts away the storage aspects of a cache - associating an object with a key, retrieval and removal via the key. It is actually a small subset of the Map interface. The implementations can be coded in a non-threadsafe manner as the natural user of the cache storage, TemplateCache does the necessary synchronization.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes all values from this cache
    get(Object key)
    Retrieve a cached value associated with a key
    void
    put(Object key, Object value)
    Associates a key with a cached value
    void
    Removes the value associated with a key, if it exists.
  • Method Details

    • get

      Object get(Object key)
      Retrieve a cached value associated with a key
      Parameters:
      key - the key for retrieving an associated value
      Returns:
      the cached value associated with the key, or null if no value is associated with the key.
    • put

      void put(Object key, Object value)
      Associates a key with a cached value
      Parameters:
      key - the key to associate with a value
      value - the value associated with the key.
    • remove

      void remove(Object key)
      Removes the value associated with a key, if it exists. If it doesn't exist, this method does nothing.
      Parameters:
      key - the key whose associated value is removed from the cache.
    • clear

      void clear()
      Removes all values from this cache