use of com.thinkbiganalytics.alerts.spi.AlertNotifyReceiver in project kylo by Teradata.
the class InMemoryAlertManager method signalReceivers.
private void signalReceivers() {
Executor exec = getRespondersExecutor();
final Set<AlertNotifyReceiver> receivers;
synchronized (this.alertReceivers) {
receivers = new HashSet<>(this.alertReceivers);
}
exec.execute(() -> {
int count = InMemoryAlertManager.this.changeCount.get();
LOG.info("Notifying receivers: {} about events: {}", receivers.size(), count);
for (AlertNotifyReceiver receiver : receivers) {
receiver.alertsAvailable(count);
}
InMemoryAlertManager.this.changeCount.getAndAdd(-count);
});
}
Aggregations