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.Information
getCurrentTransportInformation()
Gets the serialization information from aThreadLocal
that was assigned viaSerialization.withTransportInformation(akka.actor.ExtendedActorSystem, scala.Function0<T>)
.java.lang.String
serializedActorPath(ActorRef actorRef)
The serialized path of an actorRef, based on the current transport serialization information.<T> T
withTransportInformation(ExtendedActorSystem system, scala.Function0<T> f)
Sets serialization information in aThreadLocal
and 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 givenActorRef
then the systems default address will be used and that is retrieved from the ThreadLocalSerialization.Information
that 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 aThreadLocal
and 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 currentInformation
can be accessed withinf
viaSerialization.getCurrentTransportInformation()
.Akka Remoting sets this value when serializing and deserializing messages, and when using the ordinary
serialize
anddeserialize
methods inSerialization
the value is also set automatically.- Returns:
- value returned by
f
-
getCurrentTransportInformation
public Serialization.Information getCurrentTransportInformation()
Gets the serialization information from aThreadLocal
that 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
-
-