|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.velocity.runtime.resource.ResourceCacheImpl
public class ResourceCacheImpl
Default implementation of the resource cache for the default
ResourceManager. The cache uses a least recently used (LRU)
algorithm, with a maximum size specified via the
resource.manager.cache.size
property (idenfied by the
RuntimeConstants.RESOURCE_MANAGER_DEFAULTCACHE_SIZE
constant). This property get be set to 0
or less for
a greedy, unbounded cache (the behavior from pre-v1.5).
Field Summary | |
---|---|
protected Map |
cache
Cache storage, assumed to be thread-safe. |
protected RuntimeServices |
rsvc
Runtime services, generally initialized by the initialize() method. |
Constructor Summary | |
---|---|
ResourceCacheImpl()
|
Method Summary | |
---|---|
Iterator |
enumerateKeys()
returns an Iterator of Keys in the cache |
Resource |
get(Object key)
retrieves a Resource from the cache |
void |
initialize(RuntimeServices rs)
initializes the ResourceCache. |
Resource |
put(Object key,
Resource value)
stores a Resource in the cache |
Resource |
remove(Object key)
removes a Resource from the cache |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map cache
protected RuntimeServices rsvc
initialize()
method.
Constructor Detail |
---|
public ResourceCacheImpl()
Method Detail |
---|
public void initialize(RuntimeServices rs)
ResourceCache
initialize
in interface ResourceCache
rs
- RuntimeServices to use for logging, etcpublic Resource get(Object key)
ResourceCache
get
in interface ResourceCache
key
- key for Resource to be retrieved
public Resource put(Object key, Resource value)
ResourceCache
put
in interface ResourceCache
key
- key to associate with the Resourcevalue
- Resource to be stored
public Resource remove(Object key)
ResourceCache
remove
in interface ResourceCache
key
- resource to be removed
public Iterator enumerateKeys()
ResourceCache
enumerateKeys
in interface ResourceCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |