Class Entity$
- java.lang.Object
-
- akka.cluster.sharding.typed.javadsl.Entity$
-
- Type Parameters:
M- The type of message the entity accepts
public class Entity$ extends java.lang.ObjectDefines how the entity should be created. Used inClusterSharding.init(akka.cluster.sharding.typed.javadsl.Entity<M, E>). More optional settings can be defined using thewithmethods of the returnedEntity.Any
Behaviorcan be used as a sharded entity actor, but the combination of sharding and persistent actors is very common and therefore theEntity.ofPersistentEntityis provided as convenience.param: typeKey A key that uniquely identifies the type of entity in this cluster param: createBehavior Create the behavior for an entity given a
EntityContext(includes entityId)
-
-
Constructor Summary
Constructors Constructor Description Entity$()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <M> Entity<M,ShardingEnvelope<M>>of(EntityTypeKey<M> typeKey, Function<EntityContext<M>,Behavior<M>> createBehavior)<Command,Event,State>
Entity<Command,ShardingEnvelope<Command>>ofPersistentEntity(EntityTypeKey<Command> typeKey, Function<EntityContext<Command>,EventSourcedEntity<Command,Event,State>> createPersistentEntity)Defines how theEventSourcedEntityshould be created.
-
-
-
Field Detail
-
MODULE$
public static final Entity$ MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Method Detail
-
of
public <M> Entity<M,ShardingEnvelope<M>> of(EntityTypeKey<M> typeKey, Function<EntityContext<M>,Behavior<M>> createBehavior)
-
ofPersistentEntity
public <Command,Event,State> Entity<Command,ShardingEnvelope<Command>> ofPersistentEntity(EntityTypeKey<Command> typeKey, Function<EntityContext<Command>,EventSourcedEntity<Command,Event,State>> createPersistentEntity)
Defines how theEventSourcedEntityshould be created. Used inClusterSharding.init(akka.cluster.sharding.typed.javadsl.Entity<M, E>). AnyBehaviorcan be used as a sharded entity actor, but the combination of sharding and persistent actors is very common and therefore this factory is provided as convenience.More optional settings can be defined using the
withmethods of the returnedEntity.- Parameters:
typeKey- A key that uniquely identifies the type of entity in this clustercreatePersistentEntity- Create thePersistentEntityfor an entity given aEntityContext(includes entityId)- Returns:
- (undocumented)
-
-