Cleaning up the ActorRef serialization according to review. See #3137

This commit is contained in:
Björn Antonsson 2013-03-26 11:25:09 +01:00
parent 33080a4155
commit a4ab7a9841
18 changed files with 100 additions and 100 deletions

View file

@ -271,14 +271,16 @@ private[akka] class RemoteActorRefProvider(
def actorFor(ref: InternalActorRef, path: String): InternalActorRef = path match {
case ActorPathExtractor(address, elems)
if (hasAddress(address)) actorFor(rootGuardian, elems)
else try {
new RemoteActorRef(transport, transport.localAddressForRemote(address),
new RootActorPath(address) / elems, Nobody, props = None, deploy = None)
} catch {
case NonFatal(e)
val oldPath = RootActorPath(address) / elems
log.error(e, "Error while looking up address {}", oldPath.address)
new EmptyLocalActorRef(this, oldPath, eventStream)
else {
val rootPath = RootActorPath(address) / elems
try {
new RemoteActorRef(transport, transport.localAddressForRemote(address),
rootPath, Nobody, props = None, deploy = None)
} catch {
case NonFatal(e)
log.error(e, "Error while looking up address {}", rootPath.address)
new EmptyLocalActorRef(this, rootPath, eventStream)
}
}
case _ local.actorFor(ref, path)
}