Top Fields Constructors Methods
org.apache.catalina.webresources

public Class Cache

extends Object
Class Inheritance
Imports
java.util.Comparator, .Iterator, .TreeSet, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, java.util.concurrent.atomic.AtomicLong, .LongAdder, org.apache.catalina.WebResource, .WebResourceRoot.CacheStrategy, org.apache.juli.logging.Log, .LogFactory, org.apache.tomcat.util.res.StringManager

Field Summary

Modifier and TypeField and Description
private WebResourceRoot.CacheStrategy
private LongAdder
private static final Log
private LongAdder
private long
private static final int
private int
private final ConcurrentMap<String, CachedResource>
private final StandardRoot
private final AtomicLong
protected static final StringManager
private static final long
private static final long
private long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
public void
pack-priv void
private long
evict(long targetSize, Iterator<CachedResource> iter)

public WebResourceRoot.CacheStrategy
public long
public long
public long
public int
public int
protected WebResource
getResource(String path, boolean useClassLoaderResources)

protected WebResource[]
getResources(String path, boolean useClassLoaderResources)

public long
public long
private boolean
pack-priv void
public void
public void
setMaxSize(long maxSize)

public void
setObjectMaxSize(int objectMaxSize)

public void
setTtl(long ttl)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cacheStrategyback to summary
private WebResourceRoot.CacheStrategy cacheStrategy
hitCountback to summary
private LongAdder hitCount
logback to summary
private static final Log log
lookupCountback to summary
private LongAdder lookupCount
maxSizeback to summary
private long maxSize
OBJECT_MAX_SIZE_FACTORback to summary
private static final int OBJECT_MAX_SIZE_FACTOR
objectMaxSizeback to summary
private int objectMaxSize
resourceCacheback to summary
private final ConcurrentMap<String, CachedResource> resourceCache
rootback to summary
private final StandardRoot root
sizeback to summary
private final AtomicLong size
smback to summary
protected static final StringManager sm
TARGET_FREE_PERCENT_BACKGROUNDback to summary
private static final long TARGET_FREE_PERCENT_BACKGROUND
TARGET_FREE_PERCENT_GETback to summary
private static final long TARGET_FREE_PERCENT_GET
ttlback to summary
private long ttl

Constructor Detail

Cacheback to summary
public Cache(StandardRoot root)

Method Detail

backgroundProcessback to summary
protected void backgroundProcess()
clearback to summary
public void clear()
enforceObjectMaxSizeLimitback to summary
pack-priv void enforceObjectMaxSizeLimit()
evictback to summary
private long evict(long targetSize, Iterator<CachedResource> iter)
getCacheStrategyback to summary
public WebResourceRoot.CacheStrategy getCacheStrategy()
getHitCountback to summary
public long getHitCount()
getLookupCountback to summary
public long getLookupCount()
getMaxSizeback to summary
public long getMaxSize()
getObjectMaxSizeback to summary
public int getObjectMaxSize()
getObjectMaxSizeBytesback to summary
public int getObjectMaxSizeBytes()
getResourceback to summary
protected WebResource getResource(String path, boolean useClassLoaderResources)
getResourcesback to summary
protected WebResource[] getResources(String path, boolean useClassLoaderResources)
getSizeback to summary
public long getSize()
getTtlback to summary
public long getTtl()
noCacheback to summary
private boolean noCache(String path)
removeCacheEntryback to summary
pack-priv void removeCacheEntry(String path)
setCacheStrategyback to summary
public void setCacheStrategy(WebResourceRoot.CacheStrategy cacheStrategy)
setMaxSizeback to summary
public void setMaxSize(long maxSize)
setObjectMaxSizeback to summary
public void setObjectMaxSize(int objectMaxSize)
setTtlback to summary
public void setTtl(long ttl)