Remove commented-out logging
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / common / actor / AbstractUntypedActor.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.controller.cluster.common.actor;
10
11 import akka.actor.UntypedActor;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 public abstract class AbstractUntypedActor extends UntypedActor {
16     protected final Logger LOG = LoggerFactory.getLogger(getClass());
17
18     protected AbstractUntypedActor() {
19         LOG.debug("Actor created {}", getSelf());
20         getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf());
21     }
22
23     @Override
24     public void onReceive(Object message) throws Exception {
25         handleReceive(message);
26     }
27
28     protected abstract void handleReceive(Object message) throws Exception;
29
30     protected void ignoreMessage(Object message) {
31         LOG.debug("Unhandled message {}", message);
32     }
33
34     protected void unknownMessage(Object message) throws Exception {
35         LOG.debug("Received unhandled message {}", message);
36         unhandled(message);
37     }
38 }