KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > monitor > model > LogAction


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.monitor.model;
5
6 import org.oddjob.logging.LogLevel;
7
8 /**
9  *
10  */

11 abstract public class LogAction {
12     
13     abstract public void accept(LogEventProcessor processor);
14 }
15
16 class MessageEvent extends LogAction {
17     
18     private final String JavaDoc text;
19     private final LogLevel level;
20
21     public MessageEvent(String JavaDoc text, LogLevel level) {
22         this.text = text;
23         this.level = level;
24     }
25     
26     public void accept(LogEventProcessor processor) {
27         processor.onEvent(text, level);
28     }
29 }
30
31 class ClearEvent extends LogAction {
32     
33     public void accept(LogEventProcessor processor) {
34         processor.onClear();
35     }
36 }
37
38 class UnavailableEvent extends LogAction {
39     public void accept(LogEventProcessor processor) {
40         processor.onUnavailable();
41     }
42 }
43
Popular Tags