public class ResourceManager extends Object
ResourceInfo instances
and cache any that are successfully looked up to reduce the
computational overhead with the scanning/version checking.| Constructor and Description |
|---|
ResourceManager(Map<String,Object> appMap,
ResourceCache cache)
Constructs a new
ResourceManager. |
ResourceManager(ResourceCache cache) |
| Modifier and Type | Method and Description |
|---|---|
ResourceInfo |
findResource(String libraryName,
String resourceName,
String contentType,
boolean isViewResource,
javax.faces.context.FacesContext ctx) |
ResourceInfo |
findResource(String libraryName,
String resourceName,
String contentType,
javax.faces.context.FacesContext ctx)
Attempt to lookup a
ResourceInfo based on the specified
libraryName |
ResourceInfo |
findViewResource(String resourceName,
String contentType,
javax.faces.context.FacesContext facesContext) |
Stream<String> |
getViewResources(javax.faces.context.FacesContext facesContext,
String path,
int maxDepth,
javax.faces.application.ResourceVisitOption... options) |
public ResourceManager(ResourceCache cache)
public ResourceManager(Map<String,Object> appMap, ResourceCache cache)
ResourceManager. Note: if the current
ProjectStage is ProjectStage.Development caching or
ResourceInfo instances will not occur.public ResourceInfo findResource(String libraryName, String resourceName, String contentType, javax.faces.context.FacesContext ctx)
Attempt to lookup a ResourceInfo based on the specified
libraryName and resourceName
Implementation Note: Synchronization is necessary when looking up compressed resources. This ensures the atomicity of the content being compressed. As such, the cost of doing this is low as once the resource is in the cache, the lookup won't be performed again until the cache is cleared. That said, it's not a good idea to have caching disabled in a production environment if leveraging compression. If the resource isn't compressable, then we don't worry about creating a few extra copies of ResourceInfo until the cache is populated.
libraryName - the name of the library (if any)resourceName - the name of the resourcecontentType - the content type of the resource. This will be
used to determine if the resource is compressablectx - the FacesContext for the current
requestResourceInfo if a resource if found matching the
provided arguments, otherwise, return nullpublic ResourceInfo findViewResource(String resourceName, String contentType, javax.faces.context.FacesContext facesContext)
public ResourceInfo findResource(String libraryName, String resourceName, String contentType, boolean isViewResource, javax.faces.context.FacesContext ctx)
Copyright © 2010–2020 JBoss by Red Hat. All rights reserved.