Merge pull request #1523 from akka/wip-3425-defautSerialization-∂π

use original system’s default address in serializedActorPath, see #3425
This commit is contained in:
Roland Kuhn 2013-06-03 01:34:35 -07:00
commit bc7f69e530
2 changed files with 11 additions and 3 deletions

View file

@ -168,7 +168,7 @@ private[akka] trait Children { this: ActorCell ⇒
}
private def makeChild(cell: ActorCell, props: Props, name: String, async: Boolean, systemService: Boolean): ActorRef = {
if (cell.system.settings.SerializeAllCreators && props.deploy.scope != LocalScope)
if (cell.system.settings.SerializeAllCreators && !systemService && props.deploy.scope != LocalScope)
try {
val ser = SerializationExtension(cell.system)
props.args forall (arg

View file

@ -12,6 +12,7 @@ import scala.collection.mutable.ArrayBuffer
import java.io.NotSerializableException
import scala.util.{ Try, DynamicVariable }
import scala.collection.immutable
import scala.util.control.NonFatal
object Serialization {
@ -55,7 +56,12 @@ object Serialization {
case _ null
}
Serialization.currentTransportInformation.value match {
case null path.toSerializationFormat
case null originalSystem match {
case null path.toSerializationFormat
case system
try path.toSerializationFormatWithAddress(system.provider.getDefaultAddress)
catch { case NonFatal(_) path.toSerializationFormat }
}
case Information(address, system)
if (originalSystem == null || originalSystem == system)
path.toSerializationFormatWithAddress(address)
@ -136,7 +142,9 @@ class Serialization(val system: ExtendedActorSystem) extends Extension {
possibilities(0)._2
}
serializerMap.putIfAbsent(clazz, ser) match {
case null log.debug("Using serializer[{}] for message [{}]", ser.getClass.getName, clazz.getName); ser
case null
log.debug("Using serializer[{}] for message [{}]", ser.getClass.getName, clazz.getName)
ser
case some some
}
case ser ser