org.eclipse.jetty.server
类 ResourceCache

java.lang.Object
  继承者 org.eclipse.jetty.server.ResourceCache

public class ResourceCache
extends Object


嵌套类摘要
 class ResourceCache.Content
          MetaData associated with a context Resource.
 
构造方法摘要
ResourceCache(ResourceCache parent, ResourceFactory factory, MimeTypes mimeTypes, boolean useFileMappedBuffer, boolean etags)
          Constructor.
 
方法摘要
 void flushCache()
           
 int getCachedFiles()
           
 int getCachedSize()
           
protected  Buffer getDirectBuffer(Resource resource)
           
protected  Buffer getIndirectBuffer(Resource resource)
           
 int getMaxCachedFiles()
           
 int getMaxCachedFileSize()
           
 int getMaxCacheSize()
           
protected  boolean isCacheable(Resource resource)
           
 boolean isUseFileMappedBuffer()
           
 HttpContent lookup(String pathInContext)
          Get a Entry from the cache.
 void setMaxCachedFiles(int maxCachedFiles)
           
 void setMaxCachedFileSize(int maxCachedFileSize)
           
 void setMaxCacheSize(int maxCacheSize)
           
 void setUseFileMappedBuffer(boolean useFileMappedBuffer)
           
 String toString()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

构造方法详细信息

ResourceCache

public ResourceCache(ResourceCache parent,
                     ResourceFactory factory,
                     MimeTypes mimeTypes,
                     boolean useFileMappedBuffer,
                     boolean etags)
Constructor.

参数:
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 the maxCachedFiles.

setMaxCachedFiles

public void setMaxCachedFiles(int maxCachedFiles)
参数:
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.

参数:
pathInContext - The key into the cache
返回:
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.
抛出:
IOException - Problem loading the resource

isCacheable

protected boolean isCacheable(Resource resource)
参数:
resource -
返回:
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()
覆盖:
Object 中的 toString


Copyright © 2013. All Rights Reserved.