X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FRegisterChangeListenerReply.java;h=a2f04851eb72a8b1f6eb2d99cc98248ec0a11d40;hb=edcc020c8fda4b13f22a31d79c13feef0b53b0ee;hp=8d980d283db9c9187733e44c4f685287c83a97ea;hpb=fe4049d34de103016d11f3a9050853c6380646d3;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java index 8d980d283d..a2f04851eb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/RegisterChangeListenerReply.java @@ -9,31 +9,34 @@ package org.opendaylight.controller.cluster.datastore.messages; import akka.actor.ActorPath; +import akka.actor.ActorRef; import akka.actor.ActorSystem; +import akka.serialization.Serialization; import org.opendaylight.controller.protobuff.messages.registration.ListenerRegistrationMessages; public class RegisterChangeListenerReply implements SerializableMessage{ - public static final Class SERIALIZABLE_CLASS = ListenerRegistrationMessages.RegisterChangeListenerReply.class; - private final ActorPath listenerRegistrationPath; + public static final Class SERIALIZABLE_CLASS = + ListenerRegistrationMessages.RegisterChangeListenerReply.class; + private final ActorRef listenerRegistration; - public RegisterChangeListenerReply(ActorPath listenerRegistrationPath) { - this.listenerRegistrationPath = listenerRegistrationPath; + public RegisterChangeListenerReply(final ActorRef listenerRegistration) { + this.listenerRegistration = listenerRegistration; } public ActorPath getListenerRegistrationPath() { - return listenerRegistrationPath; + return listenerRegistration.path(); } @Override public ListenerRegistrationMessages.RegisterChangeListenerReply toSerializable() { return ListenerRegistrationMessages.RegisterChangeListenerReply.newBuilder() - .setListenerRegistrationPath(listenerRegistrationPath.toString()).build(); + .setListenerRegistrationPath(Serialization.serializedActorPath(listenerRegistration)).build(); } - public static RegisterChangeListenerReply fromSerializable(ActorSystem actorSystem,Object serializable){ + public static RegisterChangeListenerReply fromSerializable(final ActorSystem actorSystem,final Object serializable){ ListenerRegistrationMessages.RegisterChangeListenerReply o = (ListenerRegistrationMessages.RegisterChangeListenerReply) serializable; return new RegisterChangeListenerReply( - actorSystem.actorFor(o.getListenerRegistrationPath()).path() + actorSystem.provider().resolveActorRef(o.getListenerRegistrationPath()) ); } }