implement coherent actorFor look-up

- look-up of all actor paths in the system, even “synthetic” ones like
  “/temp”
- look-up by full URI (akka://bla/...), absolute or relative path
- look-up by ActorPath
- look-up by path elements
- look-up relative to context where applicable, supporting ".."
- proper management of AskActorRef

Have a look at ActorLookupSpec to see what it can do.
This commit is contained in:
Roland 2011-12-03 11:06:38 +01:00
parent a3e6fca530
commit 79e5c5d0d1
10 changed files with 406 additions and 37 deletions

View file

@ -141,7 +141,7 @@ class RemoteSystemDaemon(remote: Remote) extends Actor {
message.getActorPath match {
case RemoteActorPath(addr, elems) if addr == remoteAddress && elems.size > 0
val name = elems.last
systemImpl.provider.actorFor(elems.dropRight(1)) match {
systemImpl.provider.actorFor(systemImpl.lookupRoot, elems.dropRight(1)) match {
case x if x eq system.deadLetters
log.error("Parent actor does not exist, ignoring remote system daemon command [{}]", message)
case parent
@ -246,7 +246,7 @@ class RemoteMessage(input: RemoteMessageProtocol, remote: RemoteSupport, classLo
val provider = remote.system.asInstanceOf[ActorSystemImpl].provider
lazy val sender: ActorRef =
if (input.hasSender) provider.actorFor(input.getSender.getPath)
if (input.hasSender) provider.actorFor(provider.rootGuardian, input.getSender.getPath)
else remote.system.deadLetters
lazy val recipient: ActorRef = remote.system.actorFor(input.getRecipient.getPath)