Class EntityContext<M>
- java.lang.Object
-
- org.apache.pekko.cluster.sharding.typed.scaladsl.EntityContext<M>
-
public final class EntityContext<M> extends java.lang.Object
Parameter tocreateBehavior
function inEntity.apply
.Cluster Sharding is often used together with
pekko.persistence.typed.scaladsl.EventSourcedBehavior
for the entities. See more considerations inpekko.persistence.typed.PersistenceId
. ThePersistenceId
of theEventSourcedBehavior
can 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.String
entityId()
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()
-
-