Correctly serialize local actor refs from other actor systems. See #3137

This commit is contained in:
Björn Antonsson 2013-03-25 08:42:48 +01:00
parent 86fdfcd22f
commit 33080a4155
12 changed files with 151 additions and 89 deletions

View file

@ -165,14 +165,14 @@ package docs.serialization {
// Serialize
// (beneath toBinary)
// If there is no transportAddress,
// it means that either this Serializer isn't called
// If there is no SerializationInformation,
// it means that this Serializer isn't called
// within a piece of code that sets it,
// so either you need to supply your own,
// so either you need to supply your own address,
// or simply use the local path.
val identifier: String = Serialization.currentTransportAddress.value match {
case null theActorRef.path.toSerializationFormat
case address theActorRef.path.toSerializationFormatWithAddress(address)
val identifier: String = Serialization.currentTransportInformation.value match {
case null theActorRef.path.toSerializationFormat
case _: SerializationInformation Serialization.serializedActorPath(theActorRef)
}
// Then just serialize the identifier however you like