Class ResourceCache
- java.lang.Object
-
- com.sun.faces.application.resource.ResourceCache
-
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 is0
, then no check will be made making the cache static. If value of this option isless 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
Constructors Constructor Description ResourceCache()
Constructs a new ResourceCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceInfo
add(ResourceInfo info, List<String> contracts)
Add theResourceInfo
to the internal cache.void
clear()
Empty the cache.ResourceInfo
get(String name, String libraryName, String localePrefix, List<String> contracts)
-
-
-
Method Detail
-
add
public ResourceInfo add(ResourceInfo info, List<String> contracts)
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.
-
-