public class ResourceCache extends org.mortbay.component.AbstractLifeCycle implements Serializable
| Modifier and Type | Class and Description |
|---|---|
class |
ResourceCache.Content
MetaData associated with a context Resource.
|
| Modifier and Type | Field and Description |
|---|---|
protected Map |
_cache |
protected int |
_cachedFiles |
protected int |
_cachedSize |
protected ResourceCache.Content |
_leastRecentlyUsed |
protected ResourceCache.Content |
_mostRecentlyUsed |
| Constructor and Description |
|---|
ResourceCache(MimeTypes mimeTypes)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doStart() |
void |
doStop()
Stop the context.
|
protected void |
fill(ResourceCache.Content content) |
void |
flushCache() |
int |
getCachedFiles() |
int |
getCachedSize() |
int |
getMaxCachedFiles() |
int |
getMaxCachedFileSize() |
int |
getMaxCacheSize() |
ResourceCache.Content |
lookup(String pathInContext,
Resource resource) |
ResourceCache.Content |
lookup(String pathInContext,
ResourceFactory factory)
Get a Entry from the cache.
|
void |
setMaxCachedFiles(int maxCachedFiles) |
void |
setMaxCachedFileSize(int maxCachedFileSize) |
void |
setMaxCacheSize(int maxCacheSize) |
protected transient Map _cache
protected transient int _cachedSize
protected transient int _cachedFiles
protected transient ResourceCache.Content _mostRecentlyUsed
protected transient ResourceCache.Content _leastRecentlyUsed
public ResourceCache(MimeTypes mimeTypes)
public 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 void flushCache()
public ResourceCache.Content lookup(String pathInContext, ResourceFactory factory) throws IOException
pathInContext - The key into the cachefactory - If no matching entry is found, this ResourceFactory will be used to create the Resource
for the new enry that is created.pathInContext, or a new entry if no matching entry was foundIOExceptionpublic ResourceCache.Content lookup(String pathInContext, Resource resource) throws IOException
IOExceptionpublic void doStart()
throws Exception
doStart in class org.mortbay.component.AbstractLifeCycleExceptionpublic void doStop()
throws InterruptedException
doStop in class org.mortbay.component.AbstractLifeCycleInterruptedExceptionprotected void fill(ResourceCache.Content content) throws IOException
IOExceptionCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.