Class EntityContext<M>
- java.lang.Object
-
- org.apache.pekko.cluster.sharding.typed.scaladsl.EntityContext<M>
-
public final class EntityContext<M> extends java.lang.ObjectParameter tocreateBehaviorfunction inEntity.apply.Cluster Sharding is often used together with
pekko.persistence.typed.scaladsl.EventSourcedBehaviorfor the entities. See more considerations inpekko.persistence.typed.PersistenceId. ThePersistenceIdof theEventSourcedBehaviorcan typically be constructed with:PersistenceId(entityContext.entityTypeKey.name, entityContext.entityId)param: entityTypeKey the key of the entity type param: entityId the business domain identifier of the entity
-
-
Constructor Summary
Constructors Constructor Description EntityContext(EntityTypeKey<M> entityTypeKey, java.lang.String entityId, ActorRef<ClusterSharding.ShardCommand> shard)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringentityId()EntityTypeKey<M>entityTypeKey()ActorRef<ClusterSharding.ShardCommand>shard()
-
-
-
Constructor Detail
-
EntityContext
public EntityContext(EntityTypeKey<M> entityTypeKey, java.lang.String entityId, ActorRef<ClusterSharding.ShardCommand> shard)
-
-
Method Detail
-
entityId
public java.lang.String entityId()
-
entityTypeKey
public EntityTypeKey<M> entityTypeKey()
-
shard
public ActorRef<ClusterSharding.ShardCommand> shard()
-
-