Package org.apache.myfaces.config
Class MetaInfResourceCache
java.lang.Object
org.apache.myfaces.config.MetaInfResourceCache
Caches, per web application, the names of all classpath resource entries under
META-INF/
found in a single scan.
At startup several independent providers each scan META-INF/ for a different suffix
(*.faces-config.xml, *.taglib.xml, contracts/.../jakarta.faces.contract.xml).
Each scan opens and fully enumerates every jar on the classpath, so doing the walk once and letting
the providers filter the shared name set by suffix avoids walking every jar multiple times. Only the
few matching names are then resolved to URLs via ClassLoader.getResources(String) (which is
what the providers did previously anyway). The cache lives in the ExternalContext application
map, so it is scoped to the web application and released on undeploy - no static state.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoaderThe classloader used both to scan and (by the providers) to resolve matches, kept consistent so the cached names line up with whatClassLoader.getResources(String)will return.getMetaInfEntryNames(ExternalContext externalContext) Returns the names of all classpath resource entries underMETA-INF/, scanning the classpath once per web application and caching the result.
-
Field Details
-
META_INF_PREFIX
- See Also:
-
-
Method Details
-
getMetaInfEntryNames
Returns the names of all classpath resource entries underMETA-INF/, scanning the classpath once per web application and caching the result. Callers filter the returned names by suffix and resolve matches viaClassLoader.getResources(String). -
getClassLoader
The classloader used both to scan and (by the providers) to resolve matches, kept consistent so the cached names line up with whatClassLoader.getResources(String)will return.
-