com.sun.faces.application.resource
public class ResourceCache extends java.lang.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.
Modifier and Type | Class and Description |
---|---|
private static class |
ResourceCache.ResourceInfoCheckPeriodProxy |
Modifier and Type | Field and Description |
---|---|
private long |
checkPeriod
Resource check period in minutes.
|
private static java.util.logging.Logger |
LOGGER |
private MultiKeyConcurrentHashMap<java.lang.String,ResourceCache.ResourceInfoCheckPeriodProxy> |
resourceCache
The
ResourceInfo |
Constructor and Description |
---|
ResourceCache()
Constructs a new ResourceCache.
|
Modifier and Type | Method and Description |
---|---|
ResourceInfo |
add(ResourceInfo info)
Add the
ResourceInfo to the internal cache. |
void |
clear()
Empty the cache.
|
ResourceInfo |
get(java.lang.String name,
java.lang.String libraryName,
java.lang.String localePrefix) |
private java.lang.Long |
getCheckPeriod(WebConfiguration webConfig) |
private static java.lang.String |
getServletContextIdentifier(javax.servlet.ServletContext context) |
private static final java.util.logging.Logger LOGGER
private MultiKeyConcurrentHashMap<java.lang.String,ResourceCache.ResourceInfoCheckPeriodProxy> resourceCache
ResourceInfo cache.
private long checkPeriod
public ResourceInfo add(ResourceInfo info)
ResourceInfo
to the internal cache.info
- resource metadatapublic ResourceInfo get(java.lang.String name, java.lang.String libraryName, java.lang.String localePrefix)
name
- the resource namelibraryName
- the library namelocalePrefix
- the locale prefixResourceInfo
associated with key
if any.
public void clear()
Empty the cache.
private java.lang.Long getCheckPeriod(WebConfiguration webConfig)
private static java.lang.String getServletContextIdentifier(javax.servlet.ServletContext context)
Copyright © 2002-2010 Oracle America, Inc. All Rights Reserved.