Class DistributedData

  • All Implemented Interfaces:

    public abstract 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.

    This class is not intended for user extension other than for test purposes (e.g. stub implementation). More methods may be added in the future and that may break such implementations.

    • Constructor Detail

      • DistributedData

        public DistributedData()
    • Method Detail

      • withReplicatorMessageAdapter

        public static <A,​B extends ReplicatedDataBehavior<A> withReplicatorMessageAdapter​(java.util.function.Function<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. 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 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 CompletionStage callbacks. It must not be shared between several actor instances.

        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)