Deprecate actorFor in favor of ActorSelection, see #3074

* Deprecate all actorFor methods
* resolveActorRef in provider
* Identify auto receive message
* Support ActorPath in actorSelection
* Support remote actor selections
* Additional tests of actor selection
* Update tests (keep most actorFor tests)
* Update samples to use actorSelection
* Updates to documentation
* Migration guide, including motivation
This commit is contained in:
Patrik Nordwall 2013-03-26 18:17:50 +01:00
parent 641e499cc4
commit 887af975ae
80 changed files with 1496 additions and 619 deletions

View file

@ -13,6 +13,11 @@ import akka.actor.ActorRefWithCell
import akka.actor.ActorRefScope
import akka.util.Switch
import akka.actor.RootActorPath
import akka.actor.SelectParent
import akka.actor.SelectChildName
import akka.actor.SelectChildPattern
import akka.actor.Identify
import akka.actor.ActorIdentity
/**
* INTERNAL API
@ -106,6 +111,21 @@ private[akka] class RemoteSystemDaemon(
}
}
case SelectParent(m) getParent.tell(m, sender)
case s @ SelectChildName(name, m)
getChild(s.allChildNames.iterator) match {
case Nobody
s.identifyRequest foreach { x sender ! ActorIdentity(x.messageId, None) }
case child
child.tell(s.wrappedMessage, sender)
}
case SelectChildPattern(p, m)
log.error("SelectChildPattern not allowed in actorSelection of remote deployed actors")
case Identify(messageId) sender ! ActorIdentity(messageId, Some(this))
case Terminated(child: ActorRefWithCell) if child.asInstanceOf[ActorRefScope].isLocal
terminating.locked {
removeChild(child.path.elements.drop(1).mkString("/"))