1 4 package org.oddjob.monitor.model; 5 6 import org.oddjob.logging.LogLevel; 7 8 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 text; 19 private final LogLevel level; 20 21 public MessageEvent(String 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 |