Package org.apache.pekko.cluster.typed
Class SingletonActor<M>
- java.lang.Object
-
- org.apache.pekko.cluster.typed.SingletonActor<M>
-
public final class SingletonActor<M> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SingletonActor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <M> SingletonActor<M>apply(Behavior<M> behavior, java.lang.String name)Behavior<M>behavior()java.lang.Stringname()static <M> SingletonActor<M>of(Behavior<M> behavior, java.lang.String name)Java APIPropsprops()scala.Option<ClusterSingletonSettings>settings()scala.Option<M>stopMessage()SingletonActor<M>withProps(Props props)pekko.actor.typed.Propsof the singleton actor, such as dispatcher settings.SingletonActor<M>withSettings(ClusterSingletonSettings settings)Additional settings, typically loaded from configuration.SingletonActor<M>withStopMessage(M msg)Message sent to the singleton to tell it to stop, e.g.
-
-
-
Method Detail
-
apply
public static <M> SingletonActor<M> apply(Behavior<M> behavior, java.lang.String name)
- Parameters:
name- Unique name for the singletonbehavior- Behavior for the singleton
-
of
public static <M> SingletonActor<M> of(Behavior<M> behavior, java.lang.String name)
Java API- Parameters:
name- Unique name for the singletonbehavior- Behavior for the singleton
-
name
public java.lang.String name()
-
props
public Props props()
-
stopMessage
public scala.Option<M> stopMessage()
-
settings
public scala.Option<ClusterSingletonSettings> settings()
-
withProps
public SingletonActor<M> withProps(Props props)
pekko.actor.typed.Propsof the singleton actor, such as dispatcher settings.
-
withStopMessage
public SingletonActor<M> withStopMessage(M msg)
Message sent to the singleton to tell it to stop, e.g. when being migrated. If this is not defined it will be stopped automatically. It can be useful to define a custom stop message if the singleton needs to perform some asynchronous cleanup or interactions before stopping.
-
withSettings
public SingletonActor<M> withSettings(ClusterSingletonSettings settings)
Additional settings, typically loaded from configuration.
-
-