X-Git-Url: http://git.megacz.com/?p=org.ibex.js.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FFountain.java;h=f1bf14b024024e00557d7e5fbe55b62fda79ab4c;hp=c015f4ca2b74ced93ecf3bc4799245f317b97bd8;hb=5a5f5ef235158d513c1f2879dc916b115a4fa9d0;hpb=e50fec35a2318586e3bb13f3a54a8a3532afee14 diff --git a/src/org/ibex/js/Fountain.java b/src/org/ibex/js/Fountain.java index c015f4c..f1bf14b 100644 --- a/src/org/ibex/js/Fountain.java +++ b/src/org/ibex/js/Fountain.java @@ -15,7 +15,7 @@ import org.ibex.net.*; * be totally independent of the others (ie separate stream position * and state) although they draw from the same data source. */ -public abstract class Fountain extends JS.O implements JS.Cloneable { +public abstract class Fountain extends JS.Immutable implements JS.Cloneable { // Public Interface ////////////////////////////////////////////////////////////////////////////// @@ -23,8 +23,7 @@ public abstract class Fountain extends JS.O implements JS.Cloneable { public static class NotCacheableException extends Exception { } // streams are "sealed" by default to prevent accidental object leakage - public void put(Object key, Object val) { } - private Cache getCache = new Cache(100); + private Cache getCache = new Cache(100, true); protected Object _get(Object key) { return null; } public final Object get(Object key) { Object ret = getCache.get(key); @@ -43,7 +42,7 @@ public abstract class Fountain extends JS.O implements JS.Cloneable { //public String toString() { return "Stream.HTTP:" + url; } public HTTP(String url) { while (url.endsWith("/")) url = url.substring(0, url.length() - 1); this.url = url; } public Object _get(Object key) { return new HTTP(url + "/" + (String)key); } - public String getCacheKey(Vec path) throws NotCacheableException { return url; } + public String getCacheKey(Basket.List path) throws NotCacheableException { return url; } public InputStream getInputStream() throws IOException { return new org.ibex.net.HTTP(url).GET(null, null); } }