import java.util.Map;
import java.util.UUID;
import org.opendaylight.controller.eos.akka.registry.listener.type.command.RegisterListener;
+import org.opendaylight.controller.eos.akka.registry.listener.type.command.TerminateListener;
import org.opendaylight.controller.eos.akka.registry.listener.type.command.TypeListenerCommand;
import org.opendaylight.controller.eos.akka.registry.listener.type.command.TypeListenerRegistryCommand;
import org.opendaylight.controller.eos.akka.registry.listener.type.command.UnregisterListener;
private Behavior<TypeListenerRegistryCommand> onUnregisterListener(final UnregisterListener command) {
LOG.debug("Stopping entity type listener actor for: {}", command.getEntityType());
- getContext().stop(spawnedListenerActors.remove(command.getDelegateListener()));
+ final ActorRef<TypeListenerCommand> actor = spawnedListenerActors.remove(command.getDelegateListener());
+ if (actor != null) {
+ actor.tell(TerminateListener.INSTANCE);
+ }
return this;
}