X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FAbstractUntypedActor.java;fp=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2FAbstractUntypedActor.java;h=66593ae2a51e5471c1eff701b67523020923bffa;hb=55fc9479e27034acfe8d19160b34c12f7d9b780c;hp=0000000000000000000000000000000000000000;hpb=3223221fb635ce6b5918df4a60984a22306fc194;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/AbstractUntypedActor.java b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/AbstractUntypedActor.java new file mode 100644 index 0000000000..66593ae2a5 --- /dev/null +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/main/java/org/opendaylight/controller/remote/rpc/AbstractUntypedActor.java @@ -0,0 +1,36 @@ +/* + * 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.remote.rpc; + +import akka.actor.UntypedActor; +import akka.event.Logging; +import akka.event.LoggingAdapter; +import org.opendaylight.controller.remote.rpc.messages.Monitor; + +public abstract class AbstractUntypedActor extends UntypedActor { + protected final LoggingAdapter LOG = + Logging.getLogger(getContext().system(), this); + + + public AbstractUntypedActor(){ + LOG.debug("Actor created {}", getSelf()); + getContext(). + system(). + actorSelection("user/termination-monitor"). + tell(new Monitor(getSelf()), getSelf()); + } + + @Override public void onReceive(Object message) throws Exception { + LOG.debug("Received message {}", message); + handleReceive(message); + LOG.debug("Done handling message {}", message); + } + + protected abstract void handleReceive(Object message) throws Exception; +}