KickJava   Java API By Example, From Geeks To Geeks.

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


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  * The LogGenerator is a logical combination of a Handler and a Formatter.
8  * Every logger or channel must have a reference to one LogGenerator.
9  * Each LogGenerator must have an unique name in a configuration. This
10  * name is used for the referencing.
11  *
12  * @author Andreas Mecky
13  * @author Terry Dye
14  */

15 public class LogGenerator {
16
17     private Handler handler;
18     private Formatter formatter;
19     private String JavaDoc name;
20     // the filter is optional
21
private LogFilter filter;
22     
23     
24     public LogGenerator(String JavaDoc name,Handler handler,Formatter formatter) {
25         this.name = name;
26         this.handler = handler;
27         this.formatter = formatter;
28     }
29     
30     /**
31      * This method returns the Handler for this LogGenerator
32      *
33      * @return the handler
34      */

35     public Handler getHandler() {
36         return handler;
37     }
38     
39     /**
40      * This method returns the Formatter for this LogGenerator
41      *
42      * @return the Formatter
43      */

44     public Formatter getFormatter() {
45         return formatter;
46     }
47     
48     /**
49      * This method returns the name of the LogGenerator
50      *
51      * @return the name of the LogGenerator
52      */

53     public String JavaDoc getName() {
54         return name;
55     }
56
57     /**
58      * This method returns the filter if one was set
59      *
60      * @return Value the filter or NULL
61      */

62     public LogFilter getFilter() {
63         return filter;
64     }
65     
66     /**
67      * This method sets the filter associated with the generator
68      *
69      * @param filter the filter that will be used
70      */

71     public void setFilter(LogFilter filter) {
72         this.filter = filter;
73     }
74     
75 }
76
Popular Tags