Class Serialization$


  • public class Serialization$
    extends java.lang.Object
    • Field Detail

      • MODULE$

        public static final Serialization$ MODULE$
        Static reference to the singleton instance of this Scala object.
    • Constructor Detail

      • Serialization$

        public Serialization$()
    • Method Detail

      • currentTransportInformation

        public scala.util.DynamicVariable<Serialization.Information> currentTransportInformation()
        INTERNAL API: This holds a reference to the current transport serialization information used for serializing local actor refs, or if serializer library e.g. custom serializer/deserializer in Jackson need access to the current ActorSystem.
        Returns:
        (undocumented)
      • 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 given ActorRef then the systems default address will be used and that is retrieved from the ThreadLocal Serialization.Information that was set with Serialization.withTransportInformation(scala.Function0<T>).
        Parameters:
        actorRef - (undocumented)
        Returns:
        (undocumented)
      • withTransportInformation

        public <T> T withTransportInformation​(ExtendedActorSystem system,
                                              scala.Function0<T> f)
        Sets serialization information in a ThreadLocal and runs f. The information is needed for serializing local actor refs, or if serializer library e.g. custom serializer/deserializer in Jackson need access to the current ActorSystem. The current Information can be accessed within f via Serialization.getCurrentTransportInformation().

        Akka Remoting sets this value when serializing and deserializing messages, and when using the ordinary serialize and deserialize methods in Serialization the value is also set automatically.

        Parameters:
        system - (undocumented)
        f - (undocumented)
        Returns:
        value returned by f
      • getCurrentTransportInformation

        public Serialization.Information getCurrentTransportInformation()
        Gets the serialization information from a ThreadLocal that was assigned via Serialization.withTransportInformation(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 current ActorSystem.

        Returns:
        (undocumented)
        Throws:
        java.lang.IllegalStateException - if the information was not set