Fix TerminationMonitor to reference correct Monitor class 13/35113/5
authorTom Pantelis <tpanteli@brocade.com>
Fri, 19 Feb 2016 15:46:37 +0000 (10:46 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Tue, 23 Feb 2016 11:09:07 +0000 (06:09 -0500)
The TerminationMonitor actor listens for messages of type
org.opendaylight.controller.cluster.datastore.messages.Monitor
but the AbstractUntypedActor sends a message of type
org.opendaylight.controller.cluster.common.actor.Monitor.
TerminationMonitor was changed to reference the right class and
org.opendaylight.controller.cluster.datastore.messages.Monitor was
removed.

Change-Id: Ie0e8dd4face529c3b40e1227fec575a8bd4c9425
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/TerminationMonitor.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/Monitor.java [deleted file]

index ab06ff1..3820cc4 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.controller.cluster.datastore;
 
 import akka.actor.Terminated;
 import akka.actor.UntypedActor;
-import org.opendaylight.controller.cluster.datastore.messages.Monitor;
+import org.opendaylight.controller.cluster.common.actor.Monitor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -22,12 +22,11 @@ public class TerminationMonitor extends UntypedActor{
         LOG.debug("Created TerminationMonitor");
     }
 
-    @Override public void onReceive(Object message) throws Exception {
+    @Override
+    public void onReceive(Object message) throws Exception {
         if(message instanceof Terminated){
             Terminated terminated = (Terminated) message;
-            if(LOG.isDebugEnabled()) {
-                LOG.debug("Actor terminated : {}", terminated.actor());
-            }
+            LOG.debug("Actor terminated : {}", terminated.actor());
         } else if(message instanceof Monitor){
             Monitor monitor = (Monitor) message;
             getContext().watch(monitor.getActorRef());
diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/Monitor.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/Monitor.java
deleted file mode 100644 (file)
index 567f14a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.controller.cluster.datastore.messages;
-
-import akka.actor.ActorRef;
-
-public class Monitor {
-    private final ActorRef actorRef;
-
-    public Monitor(ActorRef actorRef){
-
-        this.actorRef = actorRef;
-    }
-
-    public ActorRef getActorRef() {
-        return actorRef;
-    }
-}