01: package org.codehaus.spice.netserve.connection.impl;
02:
03: import org.codehaus.dna.Logger;
04: import org.codehaus.spice.netserve.connection.impl.AbstractLoggingAcceptorMonitor;
05:
06: /**
07: * AcceptorMonitor that writes out messages to DNA Logger.
08: */
09: public class DNAAcceptorMonitor extends AbstractLoggingAcceptorMonitor {
10: /**
11: * The associated DNA Logger.
12: */
13: private final Logger m_logger;
14:
15: /**
16: * Create AcceptorMonitor that writes to DNA Logger.
17: *
18: * @param logger the logger
19: */
20: public DNAAcceptorMonitor(final Logger logger) {
21: if (null == logger) {
22: throw new NullPointerException("logger");
23: }
24: m_logger = logger;
25: }
26:
27: /**
28: * @see AbstractLoggingAcceptorMonitor#isDebugEnabled
29: */
30: protected boolean isDebugEnabled() {
31: return getLogger().isDebugEnabled();
32: }
33:
34: /**
35: * @see AbstractLoggingAcceptorMonitor#debug
36: */
37: protected void debug(final String message) {
38: getLogger().debug(message);
39: }
40:
41: /**
42: * @see AbstractLoggingAcceptorMonitor#info
43: */
44: protected void info(final String message) {
45: getLogger().info(message);
46: }
47:
48: /**
49: * @see AbstractLoggingAcceptorMonitor#warn
50: */
51: protected void warn(final String message, final Exception e) {
52: getLogger().warn(message, e);
53: }
54:
55: /**
56: * Return the logger.
57: *
58: * @return the logger
59: */
60: protected Logger getLogger() {
61: return m_logger;
62: }
63: }
|