org.eclipse.jetty.server
Class ResourceCache
java.lang.Object
org.eclipse.jetty.server.ResourceCache
public class ResourceCache
- extends Object
ResourceCache
public ResourceCache(ResourceCache parent,
ResourceFactory factory,
MimeTypes mimeTypes,
boolean useFileMappedBuffer)
ResourceCache
public ResourceCache(ResourceCache parent,
ResourceFactory factory,
MimeTypes mimeTypes)
- Constructor.
- Parameters:
mimeTypes
- Mimetype to use for meta data
getCachedSize
public int getCachedSize()
getCachedFiles
public int getCachedFiles()
getMaxCachedFileSize
public int getMaxCachedFileSize()
setMaxCachedFileSize
public void setMaxCachedFileSize(int maxCachedFileSize)
getMaxCacheSize
public int getMaxCacheSize()
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize)
getMaxCachedFiles
public int getMaxCachedFiles()
- Returns:
- Returns the maxCachedFiles.
setMaxCachedFiles
public void setMaxCachedFiles(int maxCachedFiles)
- Parameters:
maxCachedFiles
- The maxCachedFiles to set.
isUseFileMappedBuffer
public boolean isUseFileMappedBuffer()
setUseFileMappedBuffer
public void setUseFileMappedBuffer(boolean useFileMappedBuffer)
flushCache
public void flushCache()
lookup
public HttpContent lookup(String pathInContext)
throws IOException
- Get a Entry from the cache.
Get either a valid entry object or create a new one if possible.
- Parameters:
pathInContext
- The key into the cache
- Returns:
- The entry matching
pathInContext
, or a new entry
if no matching entry was found. If the content exists but is not cachable,
then a HttpContent.ResourceAsHttpContent
instance is return. If
the resource does not exist, then null is returned.
- Throws:
IOException
- Problem loading the resource
isCacheable
protected boolean isCacheable(Resource resource)
- Parameters:
resource
-
- Returns:
- True if the resource is cacheable. The default implementation tests the cache sizes.
getIndirectBuffer
protected Buffer getIndirectBuffer(Resource resource)
getDirectBuffer
protected Buffer getDirectBuffer(Resource resource)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 1995-2011 Mort Bay Consulting. All Rights Reserved.