--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2009/10/08 12:19:42 421 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableFetcher.java 2009/10/22 06:04:45 468 @@ -5,6 +5,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.logging.Logger; import com.gargoylesoftware.htmlunit.Page; @@ -14,8 +15,8 @@ import com.gargoylesoftware.htmlunit.html.HtmlElement; import com.gargoylesoftware.htmlunit.html.HtmlPage; -import dk.thoerup.curcuitbreaker.CircuitBreaker; -import dk.thoerup.curcuitbreaker.CircuitBreakerManager; +import dk.thoerup.circuitbreaker.CircuitBreaker; +import dk.thoerup.circuitbreaker.CircuitBreakerManager; public class TimetableFetcher { @@ -25,13 +26,13 @@ } - TimeoutCache> cache = new TimeoutCache>(120 * 1000); + Map> cache = new TimeoutMap>(120 * 1000); Logger logger = Logger.getLogger(TimetableFetcher.class.getName()); - List cachedLookupTimetable(String trainID, String type) throws Throwable { + List cachedLookupTimetable(String trainID, String type) throws Exception { String key = trainID+type; List list = cache.get(key); @@ -44,7 +45,7 @@ return list; } - List lookupTimetable(String trainID, String type) throws Throwable { + List lookupTimetable(String trainID, String type) throws Exception { List timetableList = new ArrayList(); String url = "http://www.bane.dk/visRute.asp?W=" + type + "&TogNr=" + trainID + "&artikelId=4276";