Class CachingPathResolver

  • All Implemented Interfaces:
    PathResolver

    public class CachingPathResolver
    extends java.lang.Object
    implements PathResolver
    Path resolver decorator that uses a generational cache to speed up parsing and formatting of JCR paths. Uncached paths are resolved using the underlying decorated path resolver.
    • Constructor Summary

      Constructors 
      Constructor Description
      CachingPathResolver​(PathResolver resolver)
      Creates a caching decorator for the given path resolver.
      CachingPathResolver​(PathResolver resolver, org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache)
      Creates a caching decorator for the given path resolver.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getJCRPath​(Path path)
      Returns the JCR path String for the given Path.
      Path getQPath​(java.lang.String path)
      Returns the Path object for the given JCR path String.
      Path getQPath​(java.lang.String path, boolean normalizeIdentifier)
      Returns the path object for the given JCR path string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CachingPathResolver

        public CachingPathResolver​(PathResolver resolver,
                                   org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache)
        Creates a caching decorator for the given path resolver. The given generational cache is used for caching.
        Parameters:
        resolver - decorated path resolver
        cache - generational cache
      • CachingPathResolver

        public CachingPathResolver​(PathResolver resolver)
        Creates a caching decorator for the given path resolver.
        Parameters:
        resolver - name resolver
    • Method Detail

      • getQPath

        public Path getQPath​(java.lang.String path)
                      throws MalformedPathException,
                             IllegalNameException,
                             javax.jcr.NamespaceException
        Returns the Path object for the given JCR path String. The path is first looked up form the generational cache and the call gets delegated to the decorated path resolver only if the cache misses.
        Specified by:
        getQPath in interface PathResolver
        Parameters:
        path - A JCR path String.
        Returns:
        A Path object.
        Throws:
        MalformedPathException - if the JCR path format is invalid
        IllegalNameException - if any of the JCR names contained in the path are invalid.
        javax.jcr.NamespaceException - if a namespace prefix can not be resolved.
        See Also:
        PathResolver.getQPath(String)
      • getJCRPath

        public java.lang.String getJCRPath​(Path path)
                                    throws javax.jcr.NamespaceException
        Returns the JCR path String for the given Path. The path is first looked up form the generational cache and the call gets delegated to the decorated path resolver only if the cache misses.
        Specified by:
        getJCRPath in interface PathResolver
        Parameters:
        path - A Path object.
        Returns:
        A JCR path String in the standard form.
        Throws:
        javax.jcr.NamespaceException - if a namespace URI can not be resolved.
        See Also:
        PathResolver.getJCRPath(org.apache.jackrabbit.spi.Path)