import akka.actor.Props;
import akka.japi.Creator;
import com.google.common.base.Preconditions;
+import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.opendaylight.controller.cluster.common.actor.AbstractUntypedActor;
import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeChangeListenerRegistration;
import org.opendaylight.controller.cluster.datastore.messages.CloseDataTreeChangeListenerRegistrationReply;
protected void handleReceive(Object message) throws Exception {
if (message instanceof CloseDataTreeChangeListenerRegistration) {
registration.close();
- getSender().tell(CloseDataTreeChangeListenerRegistrationReply.getInstance(), getSelf());
+ if (isValidSender(getSender())) {
+ getSender().tell(CloseDataTreeChangeListenerRegistrationReply.getInstance(), getSelf());
+ }
+
getSelf().tell(PoisonPill.getInstance(), getSelf());
+ } else {
+ unknownMessage(message);
}
}
return Props.create(new DataTreeChangeListenerRegistrationCreator(registration));
}
- private static final class DataTreeChangeListenerRegistrationCreator implements Creator<DataTreeChangeListenerRegistrationActor> {
+ private static final class DataTreeChangeListenerRegistrationCreator
+ implements Creator<DataTreeChangeListenerRegistrationActor> {
private static final long serialVersionUID = 1L;
+
+ @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "This field is not Serializable but we don't "
+ + "create remote instances of this actor and thus don't need it to be Serializable.")
final ListenerRegistration<DOMDataTreeChangeListener> registration;
DataTreeChangeListenerRegistrationCreator(ListenerRegistration<DOMDataTreeChangeListener> registration) {