public class ResourceCache extends Object
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 and Description |
|---|
ResourceCache()
Constructs a new ResourceCache.
|
| Modifier and Type | Method and Description |
|---|---|
ResourceInfo |
add(ResourceInfo info,
List<String> contracts)
Add the
ResourceInfo to the internal cache. |
void |
clear()
Empty the cache.
|
ResourceInfo |
get(String name,
String libraryName,
String localePrefix,
List<String> contracts) |
public ResourceInfo add(ResourceInfo info, List<String> contracts)
ResourceInfo to the internal cache.info - resource metadatacontracts - the contractspublic ResourceInfo get(String name, String libraryName, String localePrefix, List<String> contracts)
name - the resource namelibraryName - the library namelocalePrefix - the locale prefixcontracts - the contractsResourceInfo associated with key
if any.public void clear()
Empty the cache.
Copyright © 2010–2020 JBoss by Red Hat. All rights reserved.