Class EntityContext<M>
- java.lang.Object
-
- org.apache.pekko.cluster.sharding.typed.javadsl.EntityContext<M>
-
public final class EntityContext<M> extends java.lang.Object
Parameter tocreateBehavior
function inEntity.of
.Cluster Sharding is often used together with
pekko.persistence.typed.javadsl.EventSourcedBehavior
for the entities. See more considerations inpekko.persistence.typed.PersistenceId
. ThePersistenceId
of theEventSourcedBehavior
can typically be constructed with:PersistenceId.of(entityContext.getEntityTypeKey().name(), entityContext.getEntityId())
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
getEntityId()
EntityTypeKey<M>
getEntityTypeKey()
ActorRef<ClusterSharding.ShardCommand>
getShard()
-
-
-
Constructor Detail
-
EntityContext
public EntityContext(EntityTypeKey<M> entityTypeKey, java.lang.String entityId, ActorRef<ClusterSharding.ShardCommand> shard)
-
-
Method Detail
-
getEntityId
public java.lang.String getEntityId()
-
getEntityTypeKey
public EntityTypeKey<M> getEntityTypeKey()
-
getShard
public ActorRef<ClusterSharding.ShardCommand> getShard()
-
-