01: package org.jzonic.jlo;
02:
03: import org.jzonic.jlo.filter.LogFilter;
04: import org.jzonic.jlo.formatter.Formatter;
05: import org.jzonic.jlo.handler.Handler;
06:
07: /**
08: * This class is used by the LogProcessor to bundle all
09: * necessary objects together for processing. It keeps
10: * the handler, fornatter and the LogRecord that forms
11: * one log request that can be processed by the LogProcessor.
12: *
13: *@author Andreas Mecky
14: *@author Terry Dye
15: */
16: public class LogEvent {
17:
18: private Handler handler;
19: private Formatter formatter;
20: private LogRecord logrecord;
21: private LogFilter logFilter;
22:
23: public LogEvent(Handler handler, Formatter formatter,
24: LogRecord logrecord) {
25: this (handler, formatter, logrecord, null);
26: }
27:
28: /**
29: * The constructor that will create the LogEvent object
30: *
31: *@param handler the handler for this logevent
32: *@param formatter the formatter for this logevent (can be null)
33: *@param logrecord the LogRecord for this logevent
34: */
35: public LogEvent(Handler handler, Formatter formatter,
36: LogRecord logrecord, LogFilter filter) {
37: this .handler = handler;
38: this .formatter = formatter;
39: this .logrecord = logrecord;
40: this .logFilter = filter;
41: }
42:
43: /**
44: * This method returns the Handler for this logevent
45: *
46: *@return the Handler
47: */
48: public Handler getHandler() {
49: return handler;
50: }
51:
52: /**
53: * This method returns the Formatter for this logevent. The formatter can
54: * be null.
55: *
56: *@return the Formatter
57: */
58: public Formatter getFormatter() {
59: return formatter;
60: }
61:
62: /**
63: * This method returns the LogRecord for this logevent
64: *
65: *@return the LogRecord
66: */
67: public LogRecord getLogRecord() {
68: return logrecord;
69: }
70:
71: /**
72: * @return
73: */
74: public LogFilter getLogFilter() {
75: return logFilter;
76: }
77:
78: }
|