1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package ch.qos.logback.core.spi;
16
17
18
19
20
21
22
23
24
25
26 public class ConfigurationEvent {
27
28
29 public enum EventType {
30 CHANGE_DETECTOR_REGISTERED,
31
32 CHANGE_DETECTOR_RUNNING,
33 CHANGE_DETECTED,
34 CONFIGURATION_STARTED,
35 PARTIAL_CONFIGURATION_ENDED_SUCCESSFULLY,
36 CONFIGURATION_ENDED_SUCCESSFULLY,
37 CONFIGURATION_ENDED_WITH_XML_PARSING_ERRORS;
38 }
39 final EventType eventType;
40 final Object data;
41
42
43
44
45
46
47
48 private ConfigurationEvent(EventType eventType, Object data) {
49 this.eventType = eventType;
50 this.data = data;
51 }
52
53 static public ConfigurationEvent newConfigurationChangeDetectorRunningEvent(Object data) {
54 return new ConfigurationEvent(EventType.CHANGE_DETECTOR_RUNNING, data);
55 }
56
57 static public ConfigurationEvent newConfigurationChangeDetectorRegisteredEvent(Object data) {
58 return new ConfigurationEvent(EventType.CHANGE_DETECTOR_REGISTERED, data);
59 }
60 static public ConfigurationEvent newConfigurationChangeDetectedEvent(Object data) {
61 return new ConfigurationEvent(EventType.CHANGE_DETECTED, data);
62 }
63 static public ConfigurationEvent newConfigurationStartedEvent(Object data) {
64 return new ConfigurationEvent(EventType.CONFIGURATION_STARTED, data);
65 }
66 static public ConfigurationEvent newPartialConfigurationEndedSuccessfullyEvent(Object data) {
67 return new ConfigurationEvent(EventType.PARTIAL_CONFIGURATION_ENDED_SUCCESSFULLY, data);
68 }
69
70
71 static public ConfigurationEvent newConfigurationEndedSuccessfullyEvent(Object data) {
72 return new ConfigurationEvent(EventType.CONFIGURATION_ENDED_SUCCESSFULLY, data);
73 }
74 static public ConfigurationEvent newConfigurationEndedWithXMLParsingErrorsEvent(Object data) {
75 return new ConfigurationEvent(EventType.CONFIGURATION_ENDED_WITH_XML_PARSING_ERRORS, data);
76 }
77 public EventType getEventType() {
78 return eventType;
79 }
80
81 public Object getData() {
82 return data;
83 }
84
85
86 @Override
87 public String toString() {
88 return "ConfigurationEvent{" + "eventType=" + eventType + ", data=" + data + '}';
89 }
90 }