public class ResourceCache extends Object
Modifier and Type | Class and Description |
---|---|
class |
ResourceCache.Content
MetaData associated with a context Resource.
|
Constructor and Description |
---|
ResourceCache(ResourceCache parent,
ResourceFactory factory,
MimeTypes mimeTypes,
boolean useFileMappedBuffer,
boolean etags)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
flushCache() |
int |
getCachedFiles() |
int |
getCachedSize() |
protected ByteBuffer |
getDirectBuffer(Resource resource) |
protected ByteBuffer |
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) |
String |
toString() |
public ResourceCache(ResourceCache parent, ResourceFactory factory, MimeTypes mimeTypes, boolean useFileMappedBuffer, boolean etags)
mimeTypes
- Mimetype to use for meta datapublic int getCachedSize()
public int getCachedFiles()
public int getMaxCachedFileSize()
public void setMaxCachedFileSize(int maxCachedFileSize)
public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
public int getMaxCachedFiles()
public void setMaxCachedFiles(int maxCachedFiles)
maxCachedFiles
- The maxCachedFiles to set.public boolean isUseFileMappedBuffer()
public void flushCache()
public HttpContent lookup(String pathInContext) throws IOException
pathInContext
- The key into the cachepathInContext
, or a new entry
if no matching entry was found. If the content exists but is not cachable,
then a ResourceAsHttpContent
instance is return. If
the resource does not exist, then null is returned.IOException
- Problem loading the resourceprotected boolean isCacheable(Resource resource)
resource
- protected ByteBuffer getIndirectBuffer(Resource resource)
protected ByteBuffer getDirectBuffer(Resource resource)
Copyright © 1995-2015 Webtide. All Rights Reserved.