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: * The LogGenerator is a logical combination of a Handler and a Formatter.
09: * Every logger or channel must have a reference to one LogGenerator.
10: * Each LogGenerator must have an unique name in a configuration. This
11: * name is used for the referencing.
12: *
13: * @author Andreas Mecky
14: * @author Terry Dye
15: */
16: public class LogGenerator {
17:
18: private Handler handler;
19: private Formatter formatter;
20: private String name;
21: // the filter is optional
22: private LogFilter filter;
23:
24: public LogGenerator(String name, Handler handler,
25: Formatter formatter) {
26: this .name = name;
27: this .handler = handler;
28: this .formatter = formatter;
29: }
30:
31: /**
32: * This method returns the Handler for this LogGenerator
33: *
34: * @return the handler
35: */
36: public Handler getHandler() {
37: return handler;
38: }
39:
40: /**
41: * This method returns the Formatter for this LogGenerator
42: *
43: * @return the Formatter
44: */
45: public Formatter getFormatter() {
46: return formatter;
47: }
48:
49: /**
50: * This method returns the name of the LogGenerator
51: *
52: * @return the name of the LogGenerator
53: */
54: public String getName() {
55: return name;
56: }
57:
58: /**
59: * This method returns the filter if one was set
60: *
61: * @return Value the filter or NULL
62: */
63: public LogFilter getFilter() {
64: return filter;
65: }
66:
67: /**
68: * This method sets the filter associated with the generator
69: *
70: * @param filter the filter that will be used
71: */
72: public void setFilter(LogFilter filter) {
73: this.filter = filter;
74: }
75:
76: }
|