Interface ObjectCache

All Known Implementing Classes:
CacheMap, WeakCacheMap

public interface ObjectCache
Interface Helma object cache classes need to implement.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Removes all items currently stored in the cache.
    boolean
    Returns true if the collection contains an element for the key.
    int
    Returns the number of keys in object array keys that were not found in the Map.
    get(Object key)
    Gets the object associated with the specified key in the hashtable.
    Return an array with all objects currently contained in the cache.
    Returns a map of statistics about the cache
    void
    Set the Application instance for the cache.
    put(Object key, Object value)
    Puts the specified element into the hashtable, using the specified key.
    Removes the element corresponding to the key.
    void
    Called when the application holding the cache is stopped.
    int
    Return the number of objects currently stored in the cache.
    void
    Called when the application's properties have been updated to let the cache implementation update its settings.
  • Method Details

    • init

      void init(Application app)
      Set the Application instance for the cache.
      Parameters:
      app - the app instance
    • shutdown

      void shutdown()
      Called when the application holding the cache is stopped.
    • updateProperties

      void updateProperties(Properties props)
      Called when the application's properties have been updated to let the cache implementation update its settings.
      Parameters:
      props -
    • containsKey

      boolean containsKey(Object key)
      Returns true if the collection contains an element for the key.
      Parameters:
      key - the key that we are looking for
    • containsKeys

      int containsKeys(Object[] keys)
      Returns the number of keys in object array keys that were not found in the Map. Those keys that are contained in the Map are nulled out in the array.
      Parameters:
      keys - an array of key objects we are looking for
      See Also:
    • get

      Object get(Object key)
      Gets the object associated with the specified key in the hashtable.
      Parameters:
      key - the specified key
      Returns:
      the element for the key or null if the key is not defined in the hash table.
      See Also:
    • put

      Object put(Object key, Object value)
      Puts the specified element into the hashtable, using the specified key. The element may be retrieved by doing a get() with the same key. The key and the element cannot be null.
      Parameters:
      key - the specified key in the hashtable
      value - the specified element
      Returns:
      the old value of the key, or null if it did not have one.
      Throws:
      NullPointerException - If the value of the element is equal to null.
      See Also:
    • remove

      Object remove(Object key)
      Removes the element corresponding to the key. Does nothing if the key is not present.
      Parameters:
      key - the key that needs to be removed
      Returns:
      the value of key, or null if the key was not found.
    • clear

      boolean clear()
      Removes all items currently stored in the cache.
      Returns:
      true if the operation succeeded
    • size

      int size()
      Return the number of objects currently stored in the cache.
      Returns:
      the number of cached items
    • getCachedObjects

      Object[] getCachedObjects()
      Return an array with all objects currently contained in the cache.
    • getStatistics

      Map<String,Object> getStatistics()
      Returns a map of statistics about the cache