Class CmsVfsMemoryObjectCache

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

Implements a memory cache, that stores objects related to VFS files, providing a cache for the "online" and another for the "offline" project.

Since:
6.1.3
  • Constructor Details

  • Method Details

    • getVfsMemoryObjectCache

      Returns the VFS memory Object cache.

      Returns:
      the VFS memory Object cache
    • getCachedObject

      public Object getCachedObject(CmsObject cms, String rootPath)
      Return an object from the cache.

      Parameters:
      cms - the current users OpenCms context
      rootPath - the rootPath of the VFS resource to get the object for
      Returns:
      object form cache or null
    • loadVfsObject

      public Object loadVfsObject(CmsObject cms, String rootPath, org.apache.commons.collections.Transformer function)
      Uses a transformer for loading an object from a path if it has not already been cached, and then caches it.

      Parameters:
      cms - the CMS context
      rootPath - the root path from which the object should be loaded
      function - the function which should load the object from VFS if it isn't already cached
      Returns:
      the loaded object
    • putCachedObject

      public void putCachedObject(CmsObject cms, String rootPath, Object value)
      Puts an object into the cache.

      Parameters:
      cms - the CmsObject
      rootPath - the rootPath of the VFS resource to store the object for
      value - the object to store
    • flush

      protected void flush(boolean online)
      Description copied from class: CmsVfsCache
      Flushes the caches.

      Specified by:
      flush in class CmsVfsCache
      Parameters:
      online - if to flush the online or offline caches
      See Also:
    • uncacheResource

      protected void uncacheResource(CmsResource resource)
      Description copied from class: CmsVfsCache
      Removes a cached resource from the cache.

      Specified by:
      uncacheResource in class CmsVfsCache
      Parameters:
      resource - the resource
      See Also: