|
41 | 41 | import java.util.SortedSet;
|
42 | 42 | import java.util.TreeSet;
|
43 | 43 | import java.util.concurrent.ConcurrentHashMap;
|
| 44 | +import java.util.concurrent.CopyOnWriteArraySet; |
44 | 45 | import java.util.concurrent.ExecutorService;
|
45 | 46 | import java.util.concurrent.Executors;
|
46 | 47 | import java.util.concurrent.ThreadFactory;
|
@@ -124,6 +125,8 @@ public final class RuntimeEnvironment {
|
124 | 125 |
|
125 | 126 | public WatchDogService watchDog;
|
126 | 127 |
|
| 128 | + private final Set<ConfigurationChangedListener> listeners = new CopyOnWriteArraySet<>(); |
| 129 | + |
127 | 130 | public List<String> getSubFiles() {
|
128 | 131 | return subFiles;
|
129 | 132 | }
|
@@ -1679,6 +1682,10 @@ public void applyConfig(Configuration config, boolean reindex, CommandTimeoutTyp
|
1679 | 1682 | getAuthorizationFramework().reload();
|
1680 | 1683 |
|
1681 | 1684 | messagesContainer.setMessageLimit(getMessageLimit());
|
| 1685 | + |
| 1686 | + for (ConfigurationChangedListener l : listeners) { |
| 1687 | + l.onConfigurationChanged(); |
| 1688 | + } |
1682 | 1689 | }
|
1683 | 1690 |
|
1684 | 1691 | public void setIndexTimestamp() throws IOException {
|
@@ -1943,4 +1950,8 @@ public Set<String> getAuthenticationTokens() {
|
1943 | 1950 | public void setAuthenticationTokens(Set<String> tokens) {
|
1944 | 1951 | syncWriteConfiguration(tokens, Configuration::setAuthenticationTokens);
|
1945 | 1952 | }
|
| 1953 | + |
| 1954 | + public void registerListener(ConfigurationChangedListener listener) { |
| 1955 | + listeners.add(listener); |
| 1956 | + } |
1946 | 1957 | }
|
0 commit comments