Rather than keeping references on heap, clear references once the future
has been notified. Also some logging to enable debugging.
Change-Id: I2ab352db51134b30fb352a4adabc07eda0945841
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
}
void deliverNotification() {
}
void deliverNotification() {
+ LOG.trace("Start delivery of notification {}", notification);
for (ListenerRegistration<? extends DOMNotificationListener> r : subscribers) {
final DOMNotificationListener listener = r.getInstance();
if (listener != null) {
try {
for (ListenerRegistration<? extends DOMNotificationListener> r : subscribers) {
final DOMNotificationListener listener = r.getInstance();
if (listener != null) {
try {
+ LOG.trace("Notifying listener {}", listener);
listener.onNotification(notification);
listener.onNotification(notification);
+ LOG.trace("Listener notification completed");
} catch (Exception e) {
LOG.error("Delivery of notification {} caused an error in listener {}", notification, listener, e);
}
}
}
} catch (Exception e) {
LOG.error("Delivery of notification {} caused an error in listener {}", notification, listener, e);
}
}
}
+ LOG.trace("Delivery completed");
}
void setFuture() {
future.set(null);
}
void setFuture() {
future.set(null);
+ notification = null;
+ subscribers = null;
+ future = null;
}
\ No newline at end of file
}
\ No newline at end of file