Class Adapter


  • public class Adapter
    extends java.lang.Object
    Java API: Adapters between typed and untyped actors and actor systems. The underlying ActorSystem is the untyped ActorSystem which runs Akka Typed Behavior on an emulation layer. In this system typed and untyped actors can coexist.

    These methods make it possible to create typed child actor from untyped parent actor, and the opposite untyped child from typed parent. watch is also supported in both directions.

    There are also converters (toTyped, toUntyped) between untyped ActorRef and typed ActorRef, and between untyped ActorSystem and typed ActorSystem.

    • Constructor Detail

      • Adapter

        public Adapter()
    • Method Detail

      • props

        public static <T> Props props​(Creator<Behavior<T>> behavior,
                                      Props deploy)
        Wrap Behavior in an untyped Props, i.e. when spawning a typed child actor from an untyped parent actor. This is normally not needed because you can use the extension methods spawn and spawnAnonymous with an untyped ActorContext, but it's needed when using typed actors with an existing library/tool that provides an API that takes an untyped Props parameter. Cluster Sharding is an example of that.
        Parameters:
        behavior - (undocumented)
        deploy - (undocumented)
        Returns:
        (undocumented)
      • props

        public static <T> Props props​(Creator<Behavior<T>> behavior)
        Wrap Behavior in an untyped Props, i.e. when spawning a typed child actor from an untyped parent actor. This is normally not needed because you can use the extension methods spawn and spawnAnonymous with an untyped ActorContext, but it's needed when using typed actors with an existing library/tool that provides an API that takes an untyped Props parameter. Cluster Sharding is an example of that.
        Parameters:
        behavior - (undocumented)
        Returns:
        (undocumented)