Class DistributedData$

java.lang.Object
org.apache.pekko.actor.typed.ExtensionId<DistributedData>
org.apache.pekko.cluster.ddata.typed.javadsl.DistributedData$

public class DistributedData$ extends ExtensionId<DistributedData>
  • Field Details

    • MODULE$

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

    • DistributedData$

      public DistributedData$()
  • Method Details

    • get

      public DistributedData get(ActorSystem<?> system)
    • createExtension

      public DistributedData createExtension(ActorSystem<?> system)
      Description copied from class: ExtensionId
      Create the extension, will be invoked at most one time per actor system where the extension is registered.
      Specified by:
      createExtension in class ExtensionId<DistributedData>
    • withReplicatorMessageAdapter

      public <A, B extends ReplicatedData> Behavior<A> withReplicatorMessageAdapter(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 pekko.cluster.ddata.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.

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