01: /******************************************************************************
02: * ResponderERRORCOUNT.java
03: * ****************************************************************************/package org.openlaszlo.servlets.responders;
04:
05: import java.io.*;
06: import java.util.Properties;
07: import javax.servlet.ServletConfig;
08: import javax.servlet.ServletException;
09: import javax.servlet.ServletOutputStream;
10: import javax.servlet.http.HttpServletRequest;
11: import javax.servlet.http.HttpServletResponse;
12: import org.openlaszlo.utils.FileUtils;
13: import org.apache.log4j.Logger;
14:
15: public final class ResponderERRORCOUNT extends ResponderAdmin {
16: private static Logger mLogger = Logger
17: .getLogger(ResponderERRORCOUNT.class);
18:
19: protected void respondAdmin(HttpServletRequest req,
20: HttpServletResponse res) throws IOException {
21: ServletOutputStream out = res.getOutputStream();
22: try {
23: res.setContentType("text/xml");
24: // ignore the race in accessing mErrorSWFCount
25: out.println("<lps-errorcount>"
26: + Responder.getErrorSWFCount()
27: + "</lps-errorcount>");
28: if (req.getParameter("clear") != null) {
29: Responder.clearErrorSWFCount();
30: mLogger.debug(
31: /* (non-Javadoc)
32: * @i18n.test
33: * @org-mes="Cleared error count"
34: */
35: org.openlaszlo.i18n.LaszloMessages.getMessage(
36: ResponderERRORCOUNT.class.getName(),
37: "051018-41"));
38: }
39: } finally {
40: FileUtils.close(out);
41: }
42: }
43:
44: public int getMimeType() {
45: return MIME_TYPE_XML;
46: }
47: }
|