Class ClusterShardingImpl

    • Constructor Detail

      • ClusterShardingImpl

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

      • entityRefFor

        public <M> EntityRef<M> entityRefFor​(EntityTypeKey<M> typeKey,
                                             java.lang.String entityId)
        Description copied from interface: ClusterSharding
        Create an ActorRef-like reference to a specific sharded entity.

        You have to correctly specify the type of messages the target can handle via the typeKey.

        Messages sent through this EntityRef will be wrapped in a ShardingEnvelope including the here provided entityId.

        This can only be used if the default ShardingEnvelope is used, when using custom envelopes or in message entity ids you will need to use the ActorRef[E] returned by sharding init for messaging with the sharded actors.

        For in-depth documentation of its semantics, see EntityRef.

        Specified by:
        entityRefFor in interface ClusterSharding
      • entityRefFor

        public <M> EntityRef<M> entityRefFor​(EntityTypeKey<M> typeKey,
                                             java.lang.String entityId,
                                             java.lang.String dataCenter)
        Description copied from interface: ClusterSharding
        Create an ActorRef-like reference to a specific sharded entity running in another data center.

        You have to correctly specify the type of messages the target can handle via the typeKey.

        Messages sent through this EntityRef will be wrapped in a ShardingEnvelope including the here provided entityId.

        This can only be used if the default ShardingEnvelope is used, when using custom envelopes or in message entity ids you will need to use the ActorRef[E] returned by sharding init for messaging with the sharded actors.

        For in-depth documentation of its semantics, see EntityRef.

        Specified by:
        entityRefFor in interface ClusterSharding
      • entityRefFor

        public <M> EntityRef<M> entityRefFor​(EntityTypeKey<M> typeKey,
                                             java.lang.String entityId)
        Description copied from class: ClusterSharding
        Create an ActorRef-like reference to a specific sharded entity.

        You have to correctly specify the type of messages the target can handle via the typeKey.

        Messages sent through this EntityRef will be wrapped in a ShardingEnvelope including the here provided entityId.

        This can only be used if the default ShardingEnvelope is used, when using custom envelopes or in message entity ids you will need to use the ActorRef&lt;E> returned by sharding init for messaging with the sharded actors.

        For in-depth documentation of its semantics, see EntityRef.

        Specified by:
        entityRefFor in class ClusterSharding
      • entityRefFor

        public <M> EntityRef<M> entityRefFor​(EntityTypeKey<M> typeKey,
                                             java.lang.String entityId,
                                             java.lang.String dataCenter)
        Description copied from class: ClusterSharding
        Create an ActorRef-like reference to a specific sharded entity running in another data center.

        You have to correctly specify the type of messages the target can handle via the typeKey.

        Messages sent through this EntityRef will be wrapped in a ShardingEnvelope including the provided entityId.

        This can only be used if the default ShardingEnvelope is used, when using custom envelopes or in message entity ids you will need to use the ActorRef[E] returned by sharding init for messaging with the sharded actors.

        For in-depth documentation of its semantics, see EntityRef.

        Specified by:
        entityRefFor in class ClusterSharding
      • init

        public <M,​E> ActorRef<E> init​(Entity<M,​E> entity)
        Description copied from interface: ClusterSharding
        Initialize sharding for the given entity factory settings.

        It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.

        Specified by:
        init in interface ClusterSharding
      • init

        public <M,​E> ActorRef<E> init​(Entity<M,​E> entity)
        Description copied from class: ClusterSharding
        Initialize sharding for the given entity factory settings.

        It will start a shard region or a proxy depending on if the settings require role and if this node has such a role.

        Specified by:
        init in class ClusterSharding