org.apache.myfaces.resource
Class TempDirFileCacheContractResourceLoader

java.lang.Object
  extended by org.apache.myfaces.shared.resource.ResourceLoader
      extended by org.apache.myfaces.shared.resource.ContractResourceLoader
          extended by org.apache.myfaces.shared.resource.ContractResourceLoaderWrapper
              extended by org.apache.myfaces.resource.TempDirFileCacheContractResourceLoader
All Implemented Interfaces:
FacesWrapper<ContractResourceLoader>

public class TempDirFileCacheContractResourceLoader
extends ContractResourceLoaderWrapper

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 Summary
static class TempDirFileCacheContractResourceLoader.FileProducer
           
 
Nested classes/interfaces inherited from class org.apache.myfaces.shared.resource.ResourceLoader
ResourceLoader.VersionComparator
 
Field Summary
static String TEMP_FILES_LOCK_MAP
           
 
Fields inherited from class org.apache.myfaces.shared.resource.ContractResourceLoader
VERSION_INVALID
 
Constructor Summary
TempDirFileCacheContractResourceLoader(ContractResourceLoader delegate)
           
 
Method Summary
protected  void createTemporalFileVersion(FacesContext facesContext, ResourceMeta resourceMeta, File target)
           
protected  int getResourceBufferSize()
           
 InputStream getResourceInputStream(ResourceMeta resourceMeta)
           
 InputStream getResourceInputStream(ResourceMeta resourceMeta, Resource resource)
           
 URL getResourceURL(ResourceMeta resourceMeta)
           
 ContractResourceLoader getWrapped()
           
protected  void initialize()
           
 boolean resourceExists(ResourceMeta resourceMeta)
           
 
Methods inherited from class org.apache.myfaces.shared.resource.ContractResourceLoaderWrapper
createResourceMeta, createResourceMeta, getLibraryVersion, getLibraryVersion, getPrefix, getResourceVersion, getResourceVersion, getVersionComparator, libraryExists, libraryExists, setPrefix, setVersionComparator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEMP_FILES_LOCK_MAP

public static final String TEMP_FILES_LOCK_MAP
See Also:
Constant Field Values
Constructor Detail

TempDirFileCacheContractResourceLoader

public TempDirFileCacheContractResourceLoader(ContractResourceLoader delegate)
Method Detail

initialize

protected void initialize()

getResourceURL

public URL getResourceURL(ResourceMeta resourceMeta)
Overrides:
getResourceURL in class ContractResourceLoaderWrapper

getResourceInputStream

public InputStream getResourceInputStream(ResourceMeta resourceMeta,
                                          Resource resource)

getResourceInputStream

public InputStream getResourceInputStream(ResourceMeta resourceMeta)
Overrides:
getResourceInputStream in class ContractResourceLoaderWrapper

resourceExists

public boolean resourceExists(ResourceMeta resourceMeta)
Overrides:
resourceExists in class ContractResourceLoaderWrapper

createTemporalFileVersion

protected void createTemporalFileVersion(FacesContext facesContext,
                                         ResourceMeta resourceMeta,
                                         File target)

getResourceBufferSize

protected int getResourceBufferSize()

getWrapped

public ContractResourceLoader getWrapped()


Copyright © 2014 The Apache Software Foundation. All rights reserved.