Interface ObjectCache<T>

All Known Implementing Classes:
FIFOObjectCache, SimpleObjectCache

public interface ObjectCache<T>
Defines basic operations which are available for every cache. The ObjectCache is very low level and shouldn't be accessed in an direct way. You should access every ObjectCache only with a ObjectCacheManager.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addObject(ObjectKey<T> objectKey, T object)
    Adds an object under the given key to the cache.
    void
    Clear the cache.
    getObject(ObjectKey<T> objectKey)
    Get the object which is found under the given key.
    removeObject(ObjectKey<T> objectKey)
    Removes an object from the cache.
  • Method Details

    • getObject

      T getObject(ObjectKey<T> objectKey)
      Get the object which is found under the given key. Returns null when no object is found.
      Parameters:
      objectKey -
      Returns:
      Object or null if there was no object with the given key in the cache.
    • addObject

      void addObject(ObjectKey<T> objectKey, T object)
      Adds an object under the given key to the cache.
      Parameters:
      objectKey - the ObjectKey
      object - the object to be added
    • removeObject

      T removeObject(ObjectKey<T> objectKey)
      Removes an object from the cache.
      Parameters:
      objectKey - ObjectKey
      Returns:
      the bean if it was mapped before or null
    • clear

      void clear()
      Clear the cache.