Teach sal-remoterpc-connector to route actions
[controller.git] / opendaylight / md-sal / sal-remoterpc-connector / src / main / java / org / opendaylight / controller / remote / rpc / TerminationMonitor.java
index 48ccd824d41cf6b1456007012d6801d028443fce..fb034300f9964442e3481d727943430a8a3fbe80 100644 (file)
@@ -5,32 +5,29 @@
  * 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.remote.rpc;
 
 import akka.actor.Terminated;
-import akka.actor.UntypedActor;
-import akka.event.Logging;
-import akka.event.LoggingAdapter;
+import akka.actor.UntypedAbstractActor;
 import org.opendaylight.controller.cluster.common.actor.Monitor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
-public class TerminationMonitor extends UntypedActor{
-    protected final LoggingAdapter LOG =
-        Logging.getLogger(getContext().system(), this);
+public class TerminationMonitor extends UntypedAbstractActor {
+    private static final Logger LOG = LoggerFactory.getLogger(TerminationMonitor.class);
 
-    public TerminationMonitor(){
-        LOG.info("Created TerminationMonitor");
+    public TerminationMonitor() {
+        LOG.debug("Created TerminationMonitor");
     }
 
-    @Override public void onReceive(Object message) throws Exception {
-        if(message instanceof Terminated){
+    @Override
+    public void onReceive(final Object message) {
+        if (message instanceof Terminated) {
             Terminated terminated = (Terminated) message;
-            if(LOG.isDebugEnabled()) {
-                LOG.debug("Actor terminated : {}", terminated.actor());
-            }
-        }else if(message instanceof Monitor){
-          Monitor monitor = (Monitor) message;
-          getContext().watch(monitor.getActorRef());
+            LOG.debug("Actor terminated : {}", terminated.actor());
+        } else if (message instanceof Monitor) {
+            Monitor monitor = (Monitor) message;
+            getContext().watch(monitor.getActorRef());
         }
     }
 }