Class CmsMemoryObjectCache

java.lang.Object
org.opencms.cache.CmsMemoryObjectCache
All Implemented Interfaces:
I_CmsEventListener

public final class CmsMemoryObjectCache extends Object implements I_CmsEventListener
A singleton memory cache, that stores objects related with keys.

This cache listens to the I_CmsEventListener.EVENT_CLEAR_CACHES event only.

Since:
6.2.3
  • Method Details

    • getInstance

      Returns the singleton memory Object cache instance.

      Returns:
      the singleton memory Object cache instance
    • cmsEvent

      public void cmsEvent(CmsEvent event)
      Description copied from interface: I_CmsEventListener
      Acknowledge the occurrence of the specified event, implement this method to check for CmsEvents in your class.
      Specified by:
      cmsEvent in interface I_CmsEventListener
      Parameters:
      event - CmsEvent that has occurred
      See Also:
    • getCachedObject

      public Object getCachedObject(Class<?> owner, String key)
      Returns an object from the cache.

      Parameters:
      owner - the owner class of the cached object (used to ensure keys don't overlap)
      key - the key to lookup the object for
      Returns:
      an object from the cache, or null if no object matches the given key
    • putCachedObject

      public void putCachedObject(Class<?> owner, String key, Object value)
      Puts an object into the cache.

      Parameters:
      owner - the owner class of the cached object (used to ensure keys don't overlap)
      key - the key to store the object at
      value - the object to store
    • registerEventListener

      protected void registerEventListener()
      Registers all required event listeners.