Class Shard

    • Constructor Detail

      • Shard

        public Shard​(java.lang.String typeName,
                     java.lang.String shardId,
                     scala.Function1<java.lang.String,​Props> entityProps,
                     ClusterShardingSettings settings,
                     scala.PartialFunction<java.lang.Object,​scala.Tuple2<java.lang.String,​java.lang.Object>> extractEntityId,
                     scala.Function1<java.lang.Object,​java.lang.String> extractShardId,
                     java.lang.Object handOffStopMessage)
    • Method Detail

      • props

        public static Props props​(java.lang.String typeName,
                                  java.lang.String shardId,
                                  scala.Function1<java.lang.String,​Props> entityProps,
                                  ClusterShardingSettings settings,
                                  scala.PartialFunction<java.lang.Object,​scala.Tuple2<java.lang.String,​java.lang.Object>> extractEntityId,
                                  scala.Function1<java.lang.Object,​java.lang.String> extractShardId,
                                  java.lang.Object handOffStopMessage,
                                  ActorRef replicator,
                                  int majorityMinCap)
        Factory method for the Props of the Shard actor. If settings.rememberEntities is enabled the PersistentShard subclass is used, otherwise Shard.
      • context

        public ActorContext context()
        Description copied from interface: Actor
        Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

        WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

        ActorContext is the Scala API. getContext returns a AbstractActor.ActorContext, which is the Java API of the actor context.

        Specified by:
        context in interface Actor
      • self

        public final ActorRef self()
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        self in interface Actor
      • akka$actor$Actor$_setter_$context_$eq

        protected void akka$actor$Actor$_setter_$context_$eq​(ActorContext x$1)
        Description copied from interface: Actor
        Scala API: Stores the context for this actor, including self, and sender. It is implicit to support operations such as forward.

        WARNING: Only valid within the Actor itself, so do not close over it and publish it to other threads!

        ActorContext is the Scala API. getContext returns a AbstractActor.ActorContext, which is the Java API of the actor context.

        Specified by:
        akka$actor$Actor$_setter_$context_$eq in interface Actor
      • akka$actor$Actor$_setter_$self_$eq

        protected final void akka$actor$Actor$_setter_$self_$eq​(ActorRef x$1)
        Description copied from interface: Actor
        The 'self' field holds the ActorRef for this actor.

        Can be used to send messages to itself:
         self ! message
         
        Specified by:
        akka$actor$Actor$_setter_$self_$eq in interface Actor
      • state_$eq

        public void state_$eq​(Shard.State x$1)
      • idByRef

        public scala.collection.immutable.Map<ActorRef,​java.lang.String> idByRef()
      • idByRef_$eq

        public void idByRef_$eq​(scala.collection.immutable.Map<ActorRef,​java.lang.String> x$1)
      • refById

        public scala.collection.immutable.Map<java.lang.String,​ActorRef> refById()
      • refById_$eq

        public void refById_$eq​(scala.collection.immutable.Map<java.lang.String,​ActorRef> x$1)
      • lastMessageTimestamp

        public scala.collection.immutable.Map<java.lang.String,​java.lang.Object> lastMessageTimestamp()
      • lastMessageTimestamp_$eq

        public void lastMessageTimestamp_$eq​(scala.collection.immutable.Map<java.lang.String,​java.lang.Object> x$1)
      • passivating

        public scala.collection.immutable.Set<ActorRef> passivating()
      • passivating_$eq

        public void passivating_$eq​(scala.collection.immutable.Set<ActorRef> x$1)
      • passivateIdleTask

        public scala.Option<Cancellable> passivateIdleTask()
      • preStart

        public void preStart()
        Description copied from interface: Actor
        User overridable callback.

        Is called when an Actor is started. Actors are automatically started asynchronously when created. Empty default implementation.
        Specified by:
        preStart in interface Actor
      • acquireLeaseIfNeeded

        public void acquireLeaseIfNeeded()
        Will call onLeaseAcquired when completed, also when lease isn't used
      • onLeaseAcquired

        public void onLeaseAcquired()
      • processChange

        public <E extends Shard.StateChange> void processChange​(E event,
                                                                scala.Function1<E,​scala.runtime.BoxedUnit> handler)
      • receive

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receive()
        Description copied from interface: Actor
        Scala API: This defines the initial actor behavior, it must return a partial function with the actor logic.
        Specified by:
        receive in interface Actor
      • receiveCommand

        public scala.PartialFunction<java.lang.Object,​scala.runtime.BoxedUnit> receiveCommand()
      • entityTerminated

        public void entityTerminated​(ActorRef ref)
      • touchLastMessageTimestamp

        public void touchLastMessageTimestamp​(java.lang.String id)
      • deliverMessage

        public void deliverMessage​(java.lang.Object msg,
                                   ActorRef snd)
      • appendToMessageBuffer

        public void appendToMessageBuffer​(java.lang.String id,
                                          java.lang.Object msg,
                                          ActorRef snd)
      • deliverTo

        public void deliverTo​(java.lang.String id,
                              java.lang.Object msg,
                              java.lang.Object payload,
                              ActorRef snd)
      • getOrCreateEntity

        public ActorRef getOrCreateEntity​(java.lang.String id)
      • postStop

        public void postStop()
        Description copied from interface: Actor
        User overridable callback.

        Is called asynchronously after 'actor.stop()' is invoked. Empty default implementation.
        Specified by:
        postStop in interface Actor