org.apache.myfaces.resource
Class TempDirFileCacheResourceLoader
java.lang.Object
org.apache.myfaces.shared.resource.ResourceLoader
org.apache.myfaces.shared.resource.ResourceLoaderWrapper
org.apache.myfaces.resource.TempDirFileCacheResourceLoader
- All Implemented Interfaces:
- FacesWrapper<ResourceLoader>
public class TempDirFileCacheResourceLoader
- extends ResourceLoaderWrapper
ResourceLoader that uses a temporal folder to cache resources, avoiding the problem
described on MYFACES-3586 (Performance improvement in Resource loading -
HIGH CPU inflating bytes in ResourceHandlerImpl.handleResourceRequest).
- Author:
- Leonardo Uribe
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
INIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED
@JSFWebConfigParam(since="2.1.11",
expectedValues="true, false",
defaultValue="false")
public static final String INIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED
- If this param is set to true (default false), a temporal directory is created and
all files handled by this ResourceLoader are cached there, avoiding the problem
described on MYFACES-3586. (Performance improvement in Resource loading -
HIGH CPU inflating bytes in ResourceHandlerImpl.handleResourceRequest).
- See Also:
- Constant Field Values
INIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED_DEFAULT
public static final boolean INIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED_DEFAULT
- See Also:
- Constant Field Values
TEMP_FILES_LOCK_MAP
public static final String TEMP_FILES_LOCK_MAP
- See Also:
- Constant Field Values
TempDirFileCacheResourceLoader
public TempDirFileCacheResourceLoader(ResourceLoader delegate)
isValidCreateTemporalFiles
public static boolean isValidCreateTemporalFiles(FacesContext facesContext)
initialize
protected void initialize()
getResourceURL
public URL getResourceURL(ResourceMeta resourceMeta)
- Overrides:
getResourceURL
in class ResourceLoaderWrapper
getResourceInputStream
public InputStream getResourceInputStream(ResourceMeta resourceMeta,
Resource resource)
getResourceInputStream
public InputStream getResourceInputStream(ResourceMeta resourceMeta)
- Overrides:
getResourceInputStream
in class ResourceLoaderWrapper
resourceExists
public boolean resourceExists(ResourceMeta resourceMeta)
- Overrides:
resourceExists
in class ResourceLoaderWrapper
createTemporalFileVersion
protected void createTemporalFileVersion(FacesContext facesContext,
ResourceMeta resourceMeta,
File target)
getResourceBufferSize
protected int getResourceBufferSize()
getWrapped
public ResourceLoader getWrapped()
Copyright © 2013 The Apache Software Foundation. All Rights Reserved.