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 CONFIGURATION_ENDED;
36 }
37 final EventType eventType;
38 final Object data;
39
40
41
42
43
44
45
46 private ConfigurationEvent(EventType eventType, Object data) {
47 this.eventType = eventType;
48 this.data = data;
49 }
50
51 static public ConfigurationEvent newConfigurationChangeDetectorRunningEvent(Object data) {
52 return new ConfigurationEvent(EventType.CHANGE_DETECTOR_RUNNING, data);
53 }
54
55 static public ConfigurationEvent newConfigurationChangeDetectorRegisteredEvent(Object data) {
56 return new ConfigurationEvent(EventType.CHANGE_DETECTOR_REGISTERED, data);
57 }
58 static public ConfigurationEvent newConfigurationChangeDetectedEvent(Object data) {
59 return new ConfigurationEvent(EventType.CHANGE_DETECTED, data);
60 }
61 static public ConfigurationEvent newConfigurationStartedEvent(Object data) {
62 return new ConfigurationEvent(EventType.CONFIGURATION_STARTED, data);
63 }
64 static public ConfigurationEvent newConfigurationEndedEvent(Object data) {
65 return new ConfigurationEvent(EventType.CONFIGURATION_ENDED, data);
66 }
67
68 public EventType getEventType() {
69 return eventType;
70 }
71
72 public Object getData() {
73 return data;
74 }
75
76
77 @Override
78 public String toString() {
79 return "ConfigurationEvent{" + "eventType=" + eventType + ", data=" + data + '}';
80 }
81 }