Class CachingNameResolver
java.lang.Object
org.apache.jackrabbit.spi.commons.conversion.CachingNameResolver
- All Implemented Interfaces:
NameResolver
Name resolver decorator that uses a generational cache to speed up
parsing and formatting of JCR names. Uncached names are resolved using
the underlying decorated name resolver.
-
Constructor Summary
ConstructorsConstructorDescriptionCachingNameResolver(NameResolver resolver) Creates a caching decorator for the given name resolver.CachingNameResolver(NameResolver resolver, org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache) Creates a caching decorator for the given name resolver. -
Method Summary
-
Constructor Details
-
CachingNameResolver
public CachingNameResolver(NameResolver resolver, org.apache.jackrabbit.spi.commons.conversion.GenerationalCache cache) Creates a caching decorator for the given name resolver. The given generational cache is used for caching.- Parameters:
resolver- decorated name resolvercache- generational cache
-
CachingNameResolver
Creates a caching decorator for the given name resolver.- Parameters:
resolver- name resolver
-
-
Method Details
-
getQName
Returns aNamefor the given prefixed JCR name. The name is first looked up form the generational cache and the call gets delegated to the decorated name resolver only if the cache misses.- Specified by:
getQNamein interfaceNameResolver- Parameters:
jcrName- A JCR name String.- Returns:
- A
Nameobject. - Throws:
IllegalNameException- if the JCR name format is invalidNamespaceException- if the namespace prefix can not be resolved
-
getJCRName
Returns the prefixed JCR name for the givenName. The name is first looked up form the generational cache and the call gets delegated to the decorated name resolver only if the cache misses.- Specified by:
getJCRNamein interfaceNameResolver- Parameters:
name- The name object.- Returns:
- qualified JCR name in the form
prefix:localName. - Throws:
NamespaceException- if the namespace URI can not be resolved
-