java.lang.Object
com.sun.faces.application.resource.ResourceCache
This is the caching mechanism for caching ResourceInfo instances to offset the cost of looking up the resource.
This cache uses a background thread to check for modifications to the underlying webapp or JAR files containing
resources. This check is periodic, configurable via context init param
com.sun.faces.resourceUpdateCheckPeriod
. Through this config option, the cache can also be made static
or completely disabled. If the value of of this option is 0
, then no check will be made making the cache
static. If value of this option is less than 0
, then no caching will be perfomed. Otherwise, the value
of the option will be the number of minutes between modification checks.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd
(ResourceInfo info, List<String> contracts) Add theResourceInfo
to the internal cache.void
clear()
Empty the cache.
-
Constructor Details
-
ResourceCache
public ResourceCache()Constructs a new ResourceCache.
-
-
Method Details
-
add
Add theResourceInfo
to the internal cache.- Parameters:
info
- resource metadatacontracts
- the contracts- Returns:
- previous value associated with specified key, or null if there was no mapping for key
-
get
public ResourceInfo get(String name, String libraryName, String localePrefix, List<String> contracts) - Parameters:
name
- the resource namelibraryName
- the library namelocalePrefix
- the locale prefixcontracts
- the contracts- Returns:
- the
ResourceInfo
associated withkey
if any.
-
clear
public void clear()Empty the cache.
-