1 package org.apache.velocity.runtime.resource; 2 3 18 19 import java.util.Hashtable ; 20 import java.util.Map ; 21 import java.util.Iterator ; 22 import org.apache.velocity.runtime.RuntimeServices; 23 24 32 public class ResourceCacheImpl implements ResourceCache 33 { 34 37 protected Map cache = new Hashtable (); 38 39 43 protected RuntimeServices rsvc = null; 44 45 public void initialize( RuntimeServices rs ) 46 { 47 rsvc = rs; 48 49 rsvc.info("ResourceCache : initialized. (" + this.getClass() + ")"); 50 } 51 52 public Resource get( Object key ) 53 { 54 return (Resource) cache.get( key ); 55 } 56 57 public Resource put( Object key, Resource value ) 58 { 59 return (Resource) cache.put( key, value ); 60 } 61 62 public Resource remove( Object key ) 63 { 64 return (Resource) cache.remove( key ); 65 } 66 67 public Iterator enumerateKeys() 68 { 69 return cache.keySet().iterator(); 70 } 71 } 72 | Popular Tags |