X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fjs%2FFountain.java;h=f1bf14b024024e00557d7e5fbe55b62fda79ab4c;hb=a1e6b7e9307319c0195b0efbe5e5354c128be481;hp=acf617ac87faa3104aa5f8e5290a0a8684574593;hpb=19d66e161db458135518efd3539048f44e1e5622;p=org.ibex.js.git diff --git a/src/org/ibex/js/Fountain.java b/src/org/ibex/js/Fountain.java index acf617a..f1bf14b 100644 --- a/src/org/ibex/js/Fountain.java +++ b/src/org/ibex/js/Fountain.java @@ -1,4 +1,7 @@ -// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. + package org.ibex.js; import java.io.*; @@ -12,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 ////////////////////////////////////////////////////////////////////////////// @@ -20,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); @@ -40,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); } }