Class CmsVfsMemoryObjectCache

  • All Implemented Interfaces:

    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.

    • Constructor Detail

    • Method Detail

      • getCachedObject

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

        cms - the current users OpenCms context
        rootPath - the rootPath of the VFS resource to get the object for
        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.

        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
        the loaded object
      • putCachedObject

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

        cms - the CmsObject
        rootPath - the rootPath of the VFS resource to store the object for
        value - the object to store