01: package com.jamonapi.http;
02:
03: import java.io.IOException;
04:
05: import javax.servlet.ServletException;
06:
07: /**
08: * HttpMon that is used instead of HttpMonRequest when monitoring is disabled.
09: * Essentially this class will be used as a singleton with noop methods.
10: *
11: * @author steve souza
12: *
13: */
14: class HttpMonNull implements HttpMon {
15:
16: HttpMonNull() {
17: }
18:
19: public HttpMon start() {
20: return this ;
21: }
22:
23: public void stop() {
24: }
25:
26: public String getDetailLabel() {
27: return "";
28: }
29:
30: public Throwable getException() {
31: return null;
32: }
33:
34: public void setException(Throwable t) {
35: }
36:
37: public void throwException(Throwable t) throws IOException,
38: ServletException {
39: if (t instanceof ServletException)
40: throw (ServletException) t;
41: else if (t instanceof IOException)
42: throw (IOException) t;
43: else
44: throw new ServletException(t);
45: }
46:
47: }
|