/[projects]/android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java
ViewVC logotype

Diff of /android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/TimetableServlet.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 697 by torben, Mon May 3 07:42:02 2010 UTC revision 716 by torben, Mon May 10 06:53:20 2010 UTC
# Line 11  import javax.servlet.http.HttpServletReq Line 11  import javax.servlet.http.HttpServletReq
11  import javax.servlet.http.HttpServletResponse;  import javax.servlet.http.HttpServletResponse;
12    
13  import dk.thoerup.circuitbreaker.CircuitBreakerException;  import dk.thoerup.circuitbreaker.CircuitBreakerException;
14    import dk.thoerup.traininfoservice.Statistics;
15    
16  /**  /**
17   * Servlet implementation class TimetableServlet   * Servlet implementation class TimetableServlet
# Line 39  public class TimetableServlet extends Ht Line 40  public class TimetableServlet extends Ht
40                          response.sendError(400, "not enough parameters");                          response.sendError(400, "not enough parameters");
41                          return;                          return;
42                  }                  }
43                    Statistics.getInstance().incrementTimetableLookups();
44                                    
45                  String train = request.getParameter("train").trim();                  String train = request.getParameter("train").trim();
46                  String trainID;                  String trainID;
# Line 67  public class TimetableServlet extends Ht Line 69  public class TimetableServlet extends Ht
69                          response.getWriter().print(responseXML);                          response.getWriter().print(responseXML);
70                  } catch (java.io.IOException ioe) {                  } catch (java.io.IOException ioe) {
71                          logger.warning("(timetable) Read failed, train="+train + ". " + ioe.getMessage());                          logger.warning("(timetable) Read failed, train="+train + ". " + ioe.getMessage());
72                            Statistics.getInstance().incrementTimetableErrors();
73                          response.sendError(500, "Backend timed out");                          response.sendError(500, "Backend timed out");
74                  } catch (CircuitBreakerException cbe) {                  } catch (CircuitBreakerException cbe) {
75                          logger.warning("Circuitbreaker - failing fast");                          logger.warning("Circuitbreaker - failing fast");
76                            Statistics.getInstance().incrementTimetableErrors();
77                          response.sendError(500);                          response.sendError(500);
78                  }catch (Exception e) {                  }catch (Exception e) {
79                          logger.log(Level.WARNING, "failure looking up timetable: train=" +train, e);                          logger.log(Level.WARNING, "failure looking up timetable: train=" +train, e);
80                            Statistics.getInstance().incrementTimetableErrors();
81                          response.sendError(500);                          response.sendError(500);
82                  }                  }
83                                    

Legend:
Removed from v.697  
changed lines
  Added in v.716

  ViewVC Help
Powered by ViewVC 1.1.20