Class SingletonActor<M>


  • public final class SingletonActor<M>
    extends java.lang.Object
    Props of the singleton actor, such as dispatcher settings.
    • Constructor Detail

      • SingletonActor

        public SingletonActor()
    • Method Detail

      • of

        public static <M> SingletonActor<M> of​(Behavior<M> behavior,
                                               java.lang.String name)
        Java API

        Parameters:
        name - Unique name for the singleton
        behavior - Behavior for the singleton
        Returns:
        (undocumented)
      • name

        public java.lang.String name()
      • props

        public Props props()
      • stopMessage

        public scala.Option<M> stopMessage()
      • 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.
        Parameters:
        msg - (undocumented)
        Returns:
        (undocumented)
      • withSettings

        public SingletonActor<M> withSettings​(ClusterSingletonSettings settings)
        Additional settings, typically loaded from configuration.
        Parameters:
        settings - (undocumented)
        Returns:
        (undocumented)