KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jzonic > jlo > LogEvent


1 package org.jzonic.jlo;
2
3 import org.jzonic.jlo.filter.LogFilter;
4 import org.jzonic.jlo.formatter.Formatter;
5 import org.jzonic.jlo.handler.Handler;
6 /**
7  * This class is used by the LogProcessor to bundle all
8  * necessary objects together for processing. It keeps
9  * the handler, fornatter and the LogRecord that forms
10  * one log request that can be processed by the LogProcessor.
11  *
12  *@author Andreas Mecky
13  *@author Terry Dye
14  */

15 public class LogEvent {
16      
17     private Handler handler;
18     private Formatter formatter;
19     private LogRecord logrecord;
20     private LogFilter logFilter;
21
22     public LogEvent(Handler handler, Formatter formatter, LogRecord logrecord) {
23         this(handler, formatter, logrecord,null);
24     }
25     /**
26      * The constructor that will create the LogEvent object
27      *
28      *@param handler the handler for this logevent
29      *@param formatter the formatter for this logevent (can be null)
30      *@param logrecord the LogRecord for this logevent
31      */

32     public LogEvent(Handler handler, Formatter formatter, LogRecord logrecord,LogFilter filter) {
33         this.handler = handler;
34         this.formatter = formatter;
35         this.logrecord = logrecord;
36         this.logFilter = filter;
37     }
38
39
40     /**
41      * This method returns the Handler for this logevent
42      *
43      *@return the Handler
44      */

45     public Handler getHandler() {
46         return handler;
47     }
48
49
50     /**
51      * This method returns the Formatter for this logevent. The formatter can
52      * be null.
53      *
54      *@return the Formatter
55      */

56     public Formatter getFormatter() {
57         return formatter;
58     }
59
60
61     /**
62      * This method returns the LogRecord for this logevent
63      *
64      *@return the LogRecord
65      */

66     public LogRecord getLogRecord() {
67         return logrecord;
68     }
69     /**
70      * @return
71      */

72     public LogFilter getLogFilter() {
73         return logFilter;
74     }
75
76 }
77
Popular Tags