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.Object
Defines how the entity should be created. Used inClusterSharding.init(akka.cluster.sharding.typed.javadsl.Entity<M, E>)
. More optional settings can be defined using thewith
methods of the returnedEntity
.Any
Behavior
can be used as a sharded entity actor, but the combination of sharding and persistent actors is very common and therefore theEntity.ofPersistentEntity
is 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 theEventSourcedEntity
should 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 theEventSourcedEntity
should be created. Used inClusterSharding.init(akka.cluster.sharding.typed.javadsl.Entity<M, E>)
. AnyBehavior
can 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
with
methods of the returnedEntity
.- Parameters:
typeKey
- A key that uniquely identifies the type of entity in this clustercreatePersistentEntity
- Create thePersistentEntity
for an entity given aEntityContext
(includes entityId)- Returns:
- (undocumented)
-
-