Package org.apache.myfaces.resource
Class TempDirFileCacheResourceLoader
- java.lang.Object
- 
- org.apache.myfaces.resource.ResourceLoader
- 
- org.apache.myfaces.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
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classTempDirFileCacheResourceLoader.FileProducer- 
Nested classes/interfaces inherited from class org.apache.myfaces.resource.ResourceLoaderResourceLoader.VersionComparator
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static StringINIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLEDIf 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.static booleanINIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED_DEFAULTstatic StringTEMP_FILES_LOCK_MAP- 
Fields inherited from class org.apache.myfaces.resource.ResourceLoaderVERSION_INVALID
 
- 
 - 
Constructor SummaryConstructors Constructor Description TempDirFileCacheResourceLoader(ResourceLoader delegate)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcreateTemporalFileVersion(FacesContext facesContext, ResourceMeta resourceMeta, File target)protected intgetResourceBufferSize()InputStreamgetResourceInputStream(ResourceMeta resourceMeta)InputStreamgetResourceInputStream(ResourceMeta resourceMeta, Resource resource)URLgetResourceURL(ResourceMeta resourceMeta)Return the max available version found (if exists) or return null if no version available.ResourceLoadergetWrapped()protected voidinitialize()static booleanisValidCreateTemporalFiles(FacesContext facesContext)- 
Methods inherited from class org.apache.myfaces.resource.ResourceLoaderWrappercreateResourceMeta, getLibraryVersion, getPrefix, getResourceVersion, getVersionComparator, iterator, libraryExists, resourceExists, setPrefix, setVersionComparator
 - 
Methods inherited from class org.apache.myfaces.resource.ResourceLoadercreateResourceMeta
 
- 
 
- 
- 
- 
Field Detail- 
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_ENABLEDIf 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_DEFAULTpublic static final boolean INIT_PARAM_TEMPORAL_RESOURCEHANDLER_CACHE_ENABLED_DEFAULT - See Also:
- Constant Field Values
 
 - 
TEMP_FILES_LOCK_MAPpublic static final String TEMP_FILES_LOCK_MAP - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
TempDirFileCacheResourceLoaderpublic TempDirFileCacheResourceLoader(ResourceLoader delegate) 
 
- 
 - 
Method Detail- 
isValidCreateTemporalFilespublic static boolean isValidCreateTemporalFiles(FacesContext facesContext) 
 - 
initializeprotected void initialize() 
 - 
getResourceURLpublic URL getResourceURL(ResourceMeta resourceMeta) Description copied from class:ResourceLoaderReturn the max available version found (if exists) or return null if no version available.- Overrides:
- getResourceURLin class- ResourceLoaderWrapper
 
 - 
getResourceInputStreampublic InputStream getResourceInputStream(ResourceMeta resourceMeta, Resource resource) 
 - 
getResourceInputStreampublic InputStream getResourceInputStream(ResourceMeta resourceMeta) - Overrides:
- getResourceInputStreamin class- ResourceLoaderWrapper
 
 - 
createTemporalFileVersionprotected void createTemporalFileVersion(FacesContext facesContext, ResourceMeta resourceMeta, File target) 
 - 
getResourceBufferSizeprotected int getResourceBufferSize() 
 - 
getWrappedpublic ResourceLoader getWrapped() 
 
- 
 
-