| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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 | cacheCache storage, assumed to be thread-safe. | 
| protected  RuntimeServices | rsvcRuntime 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 ResourceCachers - RuntimeServices to use for logging, etcResourceCache.initialize(org.apache.velocity.runtime.RuntimeServices)public Resource get(Object key)
ResourceCache
get in interface ResourceCachekey - key for Resource to be retrieved
ResourceCache.get(java.lang.Object)
public Resource put(Object key,
                    Resource value)
ResourceCache
put in interface ResourceCachekey - key to associate with the Resourcevalue - Resource to be stored
ResourceCache.put(java.lang.Object, org.apache.velocity.runtime.resource.Resource)public Resource remove(Object key)
ResourceCache
remove in interface ResourceCachekey - resource to be removed
ResourceCache.remove(java.lang.Object)public Iterator enumerateKeys()
ResourceCache
enumerateKeys in interface ResourceCacheResourceCache.enumerateKeys()| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||