Class EntityContext<M>
- java.lang.Object
-
- akka.cluster.sharding.typed.javadsl.EntityContext<M>
-
public final class EntityContext<M> extends java.lang.ObjectParameter tocreateBehaviorfunction inEntity.of.Cluster Sharding is often used together with
EventSourcedBehaviorfor the entities. See more considerations inPersistenceId. ThePersistenceIdof theEventSourcedBehaviorcan 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.StringgetEntityId()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()
-
-