--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2009/09/27 19:14:39 348 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureServlet.java 2009/10/08 12:19:42 421 @@ -24,6 +24,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import dk.thoerup.curcuitbreaker.CircuitBreakerException; import dk.thoerup.traininfoservice.DBConnection; /** @@ -48,12 +49,16 @@ String stationName = getStationName(station); try { - beans = fetcher.lookupDepartures(station); + beans = fetcher.cachedLookupDepartures(station); } catch (java.net.SocketTimeoutException ste) { logger.warning("Read timed out, station="+station); resp.sendError(500); return; - } catch (Exception e) { + } catch (CircuitBreakerException cbe) { + logger.warning("Circuitbreaker - failing fast"); + resp.sendError(500); + return; + } catch (Throwable e) { logger.log(Level.WARNING, "Unknown exception, station=" +station, e); resp.sendError(500); return;