org.mortbay.jetty
Class ResourceCache
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.ResourceCache
- All Implemented Interfaces:
- Serializable, LifeCycle
public class ResourceCache
- extends AbstractLifeCycle
- implements Serializable
- Author:
- Greg Wilkins
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_cache
protected transient Map _cache
_cachedSize
protected transient int _cachedSize
_cachedFiles
protected transient int _cachedFiles
_mostRecentlyUsed
protected transient ResourceCache.Content _mostRecentlyUsed
_leastRecentlyUsed
protected transient ResourceCache.Content _leastRecentlyUsed
ResourceCache
public ResourceCache(MimeTypes mimeTypes)
- Constructor.
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,
ResourceFactory factory)
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 cachefactory
- If no matching entry is found, this ResourceFactory
will be used to create the Resource
for the new enry that is created.
- Returns:
- The entry matching
pathInContext
, or a new entry if no matching entry was found
- Throws:
IOException
lookup
public ResourceCache.Content lookup(String pathInContext,
Resource resource)
throws IOException
- Throws:
IOException
doStart
public void doStart()
throws Exception
- Overrides:
doStart
in class AbstractLifeCycle
- Throws:
Exception
doStop
public void doStop()
throws InterruptedException
- Stop the context.
- Overrides:
doStop
in class AbstractLifeCycle
- Throws:
InterruptedException
fill
protected void fill(ResourceCache.Content content)
throws IOException
- Throws:
IOException
Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.