Package akka.serialization
Class Serialization$
- java.lang.Object
-
- akka.serialization.Serialization$
-
public class Serialization$ extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static Serialization$MODULE$Static reference to the singleton instance of this Scala object.
-
Constructor Summary
Constructors Constructor Description Serialization$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Serialization.InformationgetCurrentTransportInformation()Gets the serialization information from aThreadLocalthat was assigned viaSerialization.withTransportInformation(akka.actor.ExtendedActorSystem, scala.Function0<T>).java.lang.StringserializedActorPath(ActorRef actorRef)The serialized path of an actorRef, based on the current transport serialization information.<T> TwithTransportInformation(ExtendedActorSystem system, scala.Function0<T> f)Sets serialization information in aThreadLocaland runsf.
-
-
-
Field Detail
-
MODULE$
public static final Serialization$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
serializedActorPath
public java.lang.String serializedActorPath(ActorRef actorRef)
The serialized path of an actorRef, based on the current transport serialization information. If there is no external address available in the givenActorRefthen the systems default address will be used and that is retrieved from the ThreadLocalSerialization.Informationthat was set withSerialization.withTransportInformation(akka.actor.ExtendedActorSystem, scala.Function0<T>).
-
withTransportInformation
public <T> T withTransportInformation(ExtendedActorSystem system, scala.Function0<T> f)
Sets serialization information in aThreadLocaland runsf. The information is needed for serializing local actor refs, or if serializer library e.g. custom serializer/deserializer in Jackson need access to the currentActorSystem. The currentInformationcan be accessed withinfviaSerialization.getCurrentTransportInformation().Akka Remoting sets this value when serializing and deserializing messages, and when using the ordinary
serializeanddeserializemethods inSerializationthe value is also set automatically.- Returns:
- value returned by
f
-
getCurrentTransportInformation
public Serialization.Information getCurrentTransportInformation()
Gets the serialization information from aThreadLocalthat was assigned viaSerialization.withTransportInformation(akka.actor.ExtendedActorSystem, scala.Function0<T>). The information is needed for serializing local actor refs, or if serializer library e.g. custom serializer/deserializer in Jackson need access to the currentActorSystem.- Throws:
java.lang.IllegalStateException- if the information was not set
-
-