Package akka.testkit
Class TestActor.DelegatingSupervisorStrategy
- java.lang.Object
-
- akka.actor.SupervisorStrategy
-
- akka.testkit.TestActor.DelegatingSupervisorStrategy
-
- Enclosing class:
- TestActor
public static class TestActor.DelegatingSupervisorStrategy extends SupervisorStrategy
INTERNAL API
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.SupervisorStrategy
SupervisorStrategy.Directive, SupervisorStrategy.Escalate$, SupervisorStrategy.Restart$, SupervisorStrategy.Resume$, SupervisorStrategy.Stop$
-
-
Constructor Summary
Constructors Constructor Description DelegatingSupervisorStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description scala.PartialFunction<java.lang.Throwable,SupervisorStrategy.Directive>
decider()
Returns the Decider that is associated with this SupervisorStrategy.void
handleChildTerminated(ActorContext context, ActorRef child, scala.collection.Iterable<ActorRef> children)
This method is called after the child has been removed from the set of children.boolean
handleFailure(ActorContext context, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
This is the main entry point: in case of a child’s failure, this method must try to handle the failure by resuming, restarting or stopping the child (and returningtrue
), or it returnsfalse
to escalate the failure, which will lead to this actor re-throwing the exception which caused the failure.void
processFailure(ActorContext context, boolean restart, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
This method is called to act on the failure of a child: restart if the flag is true, stop otherwise.void
update(ActorRef child, SupervisorStrategy supervisor)
-
Methods inherited from class akka.actor.SupervisorStrategy
defaultDecider, defaultStrategy, escalate, escalateDefault, logFailure, loggingEnabled, makeDecider, makeDecider, makeDecider, makeDecider, maxNrOfRetriesOption, restart, restartChild, resume, resumeChild, seqCauseDirective2Decider, seqThrowable2Decider, sort, stop, stoppingStrategy, withinTimeRangeOption
-
-
-
-
Method Detail
-
decider
public scala.PartialFunction<java.lang.Throwable,SupervisorStrategy.Directive> decider()
Description copied from class:SupervisorStrategy
Returns the Decider that is associated with this SupervisorStrategy. The Decider is invoked by the default implementation ofhandleFailure
to obtain the Directive to be applied.- Specified by:
decider
in classSupervisorStrategy
-
handleChildTerminated
public void handleChildTerminated(ActorContext context, ActorRef child, scala.collection.Iterable<ActorRef> children)
Description copied from class:SupervisorStrategy
This method is called after the child has been removed from the set of children. It does not need to do anything special. Exceptions thrown from this method do NOT make the actor fail if this happens during termination.- Specified by:
handleChildTerminated
in classSupervisorStrategy
-
handleFailure
public boolean handleFailure(ActorContext context, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
Description copied from class:SupervisorStrategy
This is the main entry point: in case of a child’s failure, this method must try to handle the failure by resuming, restarting or stopping the child (and returningtrue
), or it returnsfalse
to escalate the failure, which will lead to this actor re-throwing the exception which caused the failure. The exception will not be wrapped.This method calls
SupervisorStrategy.logFailure(akka.actor.ActorContext, akka.actor.ActorRef, java.lang.Throwable, akka.actor.SupervisorStrategy.Directive)
, which will log the failure unless it is escalated. You can customize the logging by settingSupervisorStrategy.loggingEnabled()
tofalse
and do the logging inside thedecider
or override thelogFailure
method.- Overrides:
handleFailure
in classSupervisorStrategy
children
- is a lazy collection (a view)
-
processFailure
public void processFailure(ActorContext context, boolean restart, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
Description copied from class:SupervisorStrategy
This method is called to act on the failure of a child: restart if the flag is true, stop otherwise.- Specified by:
processFailure
in classSupervisorStrategy
-
update
public void update(ActorRef child, SupervisorStrategy supervisor)
-
-