Package akka.actor.typed.internal
Class PoisonPillInterceptor<M>
- java.lang.Object
-
- akka.actor.typed.BehaviorInterceptor<M,M>
-
- akka.actor.typed.internal.PoisonPillInterceptor<M>
-
public final class PoisonPillInterceptor<M> extends BehaviorInterceptor<M,M>
INTERNAL APIReturns
Behaviors.stopped
forPoisonPill
signals unless it has been handled by the targetBehavior
. Used by Cluster Sharding to automatically stop entities without defining a stop message in the application protocol. Persistent actors handlePoisonPill
and run side effects after persist and process stashed messages before stopping.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.BehaviorInterceptor
BehaviorInterceptor.PreStartTarget<T>, BehaviorInterceptor.ReceiveTarget<T>, BehaviorInterceptor.SignalTarget<T>
-
-
Constructor Summary
Constructors Constructor Description PoisonPillInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Behavior<M>
aroundReceive(TypedActorContext<M> ctx, M msg, BehaviorInterceptor.ReceiveTarget<M> target)
Intercept a message sent to the running actor.Behavior<M>
aroundSignal(TypedActorContext<M> ctx, Signal signal, BehaviorInterceptor.SignalTarget<M> target)
Intercept a signal sent to the running actor.boolean
isSame(BehaviorInterceptor<java.lang.Object,java.lang.Object> other)
-
Methods inherited from class akka.actor.typed.BehaviorInterceptor
aroundStart, interceptMessageType
-
-
-
-
Method Detail
-
aroundReceive
public Behavior<M> aroundReceive(TypedActorContext<M> ctx, M msg, BehaviorInterceptor.ReceiveTarget<M> target)
Description copied from class:BehaviorInterceptor
Intercept a message sent to the running actor. Pass the message on to the next behavior in the stack by passing it totarget.apply
, returnBehaviors.same
without invokingtarget
to filter out the message.- Specified by:
aroundReceive
in classBehaviorInterceptor<M,M>
- Parameters:
ctx
- (undocumented)msg
- (undocumented)target
- (undocumented)- Returns:
- The behavior for next message or signal
-
aroundSignal
public Behavior<M> aroundSignal(TypedActorContext<M> ctx, Signal signal, BehaviorInterceptor.SignalTarget<M> target)
Description copied from class:BehaviorInterceptor
Intercept a signal sent to the running actor. Pass the signal on to the next behavior in the stack by passing it totarget.apply
.- Specified by:
aroundSignal
in classBehaviorInterceptor<M,M>
- Parameters:
ctx
- (undocumented)signal
- (undocumented)target
- (undocumented)- Returns:
- The behavior for next message or signal
-
isSame
public boolean isSame(BehaviorInterceptor<java.lang.Object,java.lang.Object> other)
- Overrides:
isSame
in classBehaviorInterceptor<M,M>
- Parameters:
other
- (undocumented)- Returns:
true
if this behavior logically the same as another behavior interceptor and can therefore be eliminated (to avoid building infinitely growing stacks of behaviors)? Default implementation is based on instance equality. Override to provide use case specific logic.
-
-