Maintaining refresh behavior when there isn't a ServiceMatcher

This commit is contained in:
Ryan Baxter
2020-03-18 16:45:48 -04:00
parent eb18c5b227
commit 8891f67b5a

View File

@@ -56,13 +56,13 @@ public class RefreshListener
// TODO Remove this in 3.0.x
if (serviceMatcher == null) {
log.warn(
"RefreshListener does not have a ServiceMatcher, refresh will not be performed. Consider"
+ "passing a ServiceMatcher in the constructor");
return;
"RefreshListener does not have a ServiceMatcher, refresh may be performed even if "
+ "the event does not target this app. Consider passing a ServiceMatcher in "
+ "the constructor");
refresh();
}
if (serviceMatcher.isForSelf(event)) {
Set<String> keys = this.contextRefresher.refresh();
log.info("Keys refreshed " + keys);
else if (serviceMatcher.isForSelf(event)) {
refresh();
}
else {
log.info("Refresh not performed, the event was targetting "
@@ -70,4 +70,9 @@ public class RefreshListener
}
}
private void refresh() {
Set<String> keys = this.contextRefresher.refresh();
log.info("Keys refreshed " + keys);
}
}