Class CmsVfsMemoryObjectCache

  • All Implemented Interfaces:
    I_CmsEventListener

    public class CmsVfsMemoryObjectCache
    extends CmsVfsCache
    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 Detail

    • Method Detail

      • getCachedObject

        public java.lang.Object getCachedObject​(CmsObject cms,
                                                java.lang.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 java.lang.Object loadVfsObject​(CmsObject cms,
                                              java.lang.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,
                                    java.lang.String rootPath,
                                    java.lang.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