org.eclipse.jetty.server
Class ResourceCache
java.lang.Object
org.eclipse.jetty.server.ResourceCache
public class ResourceCache
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ResourceCache
public ResourceCache(ResourceCache parent,
ResourceFactory factory,
MimeTypes mimeTypes,
boolean fileMappedBuffers)
- Constructor.
- Parameters:
mimeTypes
- Mimetype to use for meta datafileMappedBuffers
- True if file mapped buffers can be used for DirectBuffers
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.
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)
Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.