Class BehaviorSetup<C,​E,​S>


  • public final class BehaviorSetup<C,​E,​S>
    extends java.lang.Object
    INTERNAL API: Carry state for the Persistent behavior implementation behaviors.
    • Method Detail

      • emptyState

        public S emptyState()
      • commandHandler

        public scala.Function2<S,​C,​Effect<E,​S>> commandHandler()
      • eventHandler

        public scala.Function2<S,​E,​S> eventHandler()
      • tagger

        public scala.Function1<E,​scala.collection.immutable.Set<java.lang.String>> tagger()
      • eventAdapter

        public EventAdapter<E,​java.lang.Object> eventAdapter()
      • snapshotWhen

        public scala.Function3<S,​E,​java.lang.Object,​java.lang.Object> snapshotWhen()
      • holdingRecoveryPermit

        public boolean holdingRecoveryPermit()
      • holdingRecoveryPermit_$eq

        public void holdingRecoveryPermit_$eq​(boolean x$1)
      • snapshotStore

        public ActorRef snapshotStore()
      • selfClassic

        public ActorRef selfClassic()
      • log

        public org.slf4j.Logger log()
      • setMdcPhase

        public BehaviorSetup<C,​E,​S> setMdcPhase​(java.lang.String phaseName)
      • startRecoveryTimer

        public void startRecoveryTimer​(boolean snapshot)
      • cancelRecoveryTimer

        public void cancelRecoveryTimer()
      • onSignal

        public <T> boolean onSignal​(S state,
                                    Signal signal,
                                    boolean catchAndLog)
        Applies the signalHandler if defined and returns true, otherwise returns false. If an exception is thrown and catchAndLog=true it is logged and returns true, otherwise it is thrown.

        catchAndLog=true should be used for "unknown" signals in the phases before Running to avoid restart loops if restart supervision is used.