Ensure AbstractUntypedActor#unknownMessage() is called
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DataChangeListener.java
index cf3bdce331b21d5a3e2b9257cb809f3d87948567..7f985263c371c8dcfc669251c43dd705b2466704 100644 (file)
@@ -32,17 +32,18 @@ public class DataChangeListener extends AbstractUntypedActor {
     private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener;
     private boolean notificationsEnabled = false;
 
     private final AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener;
     private boolean notificationsEnabled = false;
 
-    public DataChangeListener(AsyncDataChangeListener<YangInstanceIdentifier,
-                                                      NormalizedNode<?, ?>> listener) {
+    public DataChangeListener(AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>> listener) {
         this.listener = Preconditions.checkNotNull(listener, "listener should not be null");
     }
 
     @Override
         this.listener = Preconditions.checkNotNull(listener, "listener should not be null");
     }
 
     @Override
-    public void handleReceive(Object message) throws Exception {
-        if(message instanceof DataChanged){
+    public void handleReceive(Object message) {
+        if (message instanceof DataChanged){
             dataChanged(message);
             dataChanged(message);
-        } else if(message instanceof EnableNotification){
+        } else if (message instanceof EnableNotification){
             enableNotification((EnableNotification) message);
             enableNotification((EnableNotification) message);
+        } else {
+            unknownMessage(message);
         }
     }
 
         }
     }
 
@@ -56,8 +57,7 @@ public class DataChangeListener extends AbstractUntypedActor {
 
         // Do nothing if notifications are not enabled
         if(!notificationsEnabled) {
 
         // Do nothing if notifications are not enabled
         if(!notificationsEnabled) {
-            LOG.debug("Notifications not enabled for listener {} - dropping change notification",
-                    listener);
+            LOG.debug("Notifications not enabled for listener {} - dropping change notification", listener);
             return;
         }
 
             return;
         }