Class DistributedData

  • All Implemented Interfaces:
    Extension

    public class DistributedData
    extends java.lang.Object
    implements Extension
    Akka extension for convenient configuration and use of the Replicator. Configuration settings are defined in the akka.cluster.ddata section, see reference.conf.

    This is using the same underlying Replicator instance as DistributedData and that means that typed and classic actors can share the same data.

    • Constructor Detail

      • DistributedData

        public DistributedData​(ActorSystem<?> system)
    • Method Detail

      • withReplicatorMessageAdapter

        public static <A,​B extends ReplicatedDataBehavior<A> withReplicatorMessageAdapter​(scala.Function1<ReplicatorMessageAdapter<A,​B>,​Behavior<A>> factory)
        When interacting with the DistributedData.replicator from an actor the ReplicatorMessageAdapter provides convenient methods that adapts the response messages to the requesting actor's message protocol.

        One ReplicatorMessageAdapter instance can be used for a given ReplicatedData type, e.g. an OrSet[String]. Interaction with several Keys can be used via the same adapter but they must all be of the same ReplicatedData type. For interaction with several different ReplicatedData types, e.g. an OrSet[String] and a GCounter, an adapter can be created for each type.

        *Warning*: A ReplicatorMessageAdapter instance is not thread-safe and must only be used from a single actor It must not be accessed from threads other than the ordinary actor message processing thread, such as Future callbacks. It must not be shared between several actor instances.

        Parameters:
        factory - Factory of the Behavior for the actor that is using the ReplicatorMessageAdapter

      • apply

        public static final T apply​(ActorSystem<?> system)
      • hashCode

        public static final int hashCode()
      • equals

        public static final boolean equals​(java.lang.Object other)