From 073b32d836bb401d0295171152097591a355cbb9 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 16 Jan 2016 15:59:41 +0100 Subject: [PATCH] Clear out router event on completion 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 --- .../sal/dom/broker/impl/DOMNotificationRouterEvent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouterEvent.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouterEvent.java index 85f93a6238..0367cab382 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouterEvent.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouterEvent.java @@ -47,20 +47,26 @@ final class DOMNotificationRouterEvent { } void deliverNotification() { + LOG.trace("Start delivery of notification {}", notification); for (ListenerRegistration r : subscribers) { final DOMNotificationListener listener = r.getInstance(); if (listener != null) { try { + LOG.trace("Notifying listener {}", listener); listener.onNotification(notification); + LOG.trace("Listener notification completed"); } 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); + notification = null; + subscribers = null; + future = null; } - } \ No newline at end of file -- 2.36.6