01: package org.codehaus.spice.netserve.connection.impl;
02:
03: import org.apache.avalon.framework.logger.Logger;
04:
05: /**
06: * AcceptorMonitor that writes out messages to Avalon Logger.
07: */
08: public class AvalonAcceptorMonitor extends
09: AbstractLoggingAcceptorMonitor {
10: /**
11: * The associated Avalon Logger.
12: */
13: private final Logger m_logger;
14:
15: /**
16: * Create AcceptorMonitor that writes to Avalon Logger.
17: *
18: * @param logger the logger
19: */
20: public AvalonAcceptorMonitor(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: }
|