package org.opendaylight.controller.cluster.common.actor;
import akka.actor.UntypedActor;
-import akka.event.Logging;
-import akka.event.LoggingAdapter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class AbstractUntypedActor extends UntypedActor {
- protected final LoggingAdapter LOG =
- Logging.getLogger(getContext().system(), this);
+ protected final Logger LOG = LoggerFactory.getLogger(getClass());
- public AbstractUntypedActor() {
+ protected AbstractUntypedActor() {
LOG.debug("Actor created {}", getSelf());
- getContext().
- system().
- actorSelection("user/termination-monitor").
- tell(new Monitor(getSelf()), getSelf());
-
+ getContext().system().actorSelection("user/termination-monitor").tell(new Monitor(getSelf()), getSelf());
}
- @Override public void onReceive(Object message) throws Exception {
- final String messageType = message.getClass().getSimpleName();
- LOG.debug("Received message {}", messageType);
-
+ @Override
+ public void onReceive(Object message) throws Exception {
handleReceive(message);
-
- LOG.debug("Done handling message {}", messageType);
}
protected abstract void handleReceive(Object message) throws Exception;
protected void ignoreMessage(Object message) {
- LOG.debug("Unhandled message {} ", message);
+ LOG.debug("Unhandled message {}", message);
}
protected void unknownMessage(Object message) throws Exception {