public class ResourceCacheImpl extends Object implements ResourceCache
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).| Modifier and Type | Field and Description |
|---|---|
protected Map |
cache
Cache storage, assumed to be thread-safe.
|
protected RuntimeServices |
rsvc
Runtime services, generally initialized by the
initialize() method. |
| Constructor and Description |
|---|
ResourceCacheImpl() |
| Modifier and Type | Method and Description |
|---|---|
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
|
protected Map cache
protected RuntimeServices rsvc
initialize() method.public void initialize(RuntimeServices rs)
ResourceCacheinitialize in interface ResourceCachers - RuntimeServices to use for logging, etcResourceCache.initialize(org.apache.velocity.runtime.RuntimeServices)public Resource get(Object key)
ResourceCacheget in interface ResourceCachekey - key for Resource to be retrievedResourceCache.get(java.lang.Object)public Resource put(Object key, Resource value)
ResourceCacheput in interface ResourceCachekey - key to associate with the Resourcevalue - Resource to be storedResourceCache.put(java.lang.Object, org.apache.velocity.runtime.resource.Resource)public Resource remove(Object key)
ResourceCacheremove in interface ResourceCachekey - resource to be removedResourceCache.remove(java.lang.Object)public Iterator enumerateKeys()
ResourceCacheenumerateKeys in interface ResourceCacheResourceCache.enumerateKeys()Copyright © 2000–2016. All rights reserved.