org.eclipse.jetty.server
Class ResourceCache

java.lang.Object
  extended by org.eclipse.jetty.server.ResourceCache

public class ResourceCache
extends Object


Nested Class Summary
 class ResourceCache.Content
          MetaData associated with a context Resource.
 class ResourceCache.Miss
          MetaData associated with a context Resource.
 
Constructor Summary
ResourceCache(ResourceFactory factory, MimeTypes mimeTypes, boolean fileMappedBuffers)
          Constructor.
 
Method Summary
 void flushCache()
           
 int getCachedFiles()
           
 int getCachedSize()
           
protected  Buffer getDirectBuffer(Resource resource)
           
protected  Buffer getIndirectBuffer(Resource resource)
           
 int getMaxCachedFiles()
           
 int getMaxCachedFileSize()
           
 int getMaxCacheSize()
           
 ResourceCache.Content lookup(String pathInContext)
          Get a Entry from the cache.
 void miss(String pathInContext, Resource resource)
          Remember a Resource Miss!
 void setMaxCachedFiles(int maxCachedFiles)
           
 void setMaxCachedFileSize(int maxCachedFileSize)
           
 void setMaxCacheSize(int maxCacheSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCache

public ResourceCache(ResourceFactory factory,
                     MimeTypes mimeTypes,
                     boolean fileMappedBuffers)
Constructor.

Parameters:
mimeTypes - Mimetype to use for meta data
fileMappedBuffers - True if file mapped buffers can be used for DirectBuffers
Method Detail

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 ResourceCache.Content 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
Throws:
IOException - Problem loading the resource

miss

public void miss(String pathInContext,
                 Resource resource)
Remember a Resource Miss!

Parameters:
pathInContext - Path the cache resource at
resource - The resource to cache.

getIndirectBuffer

protected Buffer getIndirectBuffer(Resource resource)

getDirectBuffer

protected Buffer getDirectBuffer(Resource resource)


Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.