Package org.apache.pekko.actor
Class SupervisorStrategy$
java.lang.Object
org.apache.pekko.actor.SupervisorStrategy$
- All Implemented Interfaces:
SupervisorStrategyLowPriorityImplicits
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SupervisorStrategy$Static reference to the singleton instance of this Scala object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal scala.PartialFunction<Throwable,SupervisorStrategy.Directive> When supervisorStrategy is not specified for an actor thisDecideris used by default in the supervisor strategy.final SupervisorStrategyWhen supervisorStrategy is not specified for an actor this is used by default.escalate()Java API: Returning this directive escalates the failure to the supervisor of the supervisor, by rethrowing the cause of the failure, i.e.scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(Iterable<Class<? extends Throwable>> trapExit) Decider builder which just checks whether one of the given Throwables matches the cause and restarts, otherwise escalates.scala.PartialFunction<Throwable,SupervisorStrategy.Directive> Converts a Java Decider into a Scala Deciderscala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(scala.collection.immutable.Seq<Class<? extends Throwable>> trapExit) Decider builder which just checks whether one of the given Throwables matches the cause and restarts, otherwise escalates.scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(scala.collection.Iterable<scala.Tuple2<Class<? extends Throwable>, SupervisorStrategy.Directive>> flat) Decider builder for Iterables of cause-directive pairs, e.g.restart()Java API: Returning this directive discards the old Actor instance and replaces it with a new, then resumes message processing.restart(Logging.LogLevel logLevel) Returning this directive discards the old Actor instance and replaces it with a new, then resumes message processing.resume()Java API: Returning this directive resumes message processing for the failed Actorresume(Logging.LogLevel logLevel) Returning this directive resumes message processing for the failed Actor.scala.PartialFunction<Throwable,SupervisorStrategy.Directive> seqThrowable2Decider(scala.collection.immutable.Seq<Class<? extends Throwable>> trapExit) Implicit conversion fromSeqof Throwables to aDecider.stop()Java API: Returning this directive stops the Actorstop(Logging.LogLevel logLevel) Returning this directive stops the Actorfinal SupervisorStrategyThis strategy resembles Erlang in that failing children are always terminated (one-for-one).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.actor.SupervisorStrategyLowPriorityImplicits
seqCauseDirective2Decider
-
Field Details
-
MODULE$
Static reference to the singleton instance of this Scala object.
-
-
Constructor Details
-
SupervisorStrategy$
public SupervisorStrategy$()
-
-
Method Details
-
resume
Java API: Returning this directive resumes message processing for the failed Actor -
resume
Returning this directive resumes message processing for the failed Actor.- Parameters:
logLevel- Log level which will be used to log the failure
-
restart
Java API: Returning this directive discards the old Actor instance and replaces it with a new, then resumes message processing. -
restart
Returning this directive discards the old Actor instance and replaces it with a new, then resumes message processing.- Parameters:
logLevel- Log level which will be used to log the failure
-
stop
Java API: Returning this directive stops the Actor -
stop
Returning this directive stops the Actor- Parameters:
logLevel- Log level which will be used to log the failure
-
escalate
Java API: Returning this directive escalates the failure to the supervisor of the supervisor, by rethrowing the cause of the failure, i.e. the supervisor fails with the same exception as the child. -
defaultDecider
When supervisorStrategy is not specified for an actor thisDecideris used by default in the supervisor strategy. The child will be stopped whenpekko.actor.ActorInitializationException,pekko.actor.ActorKilledException, orpekko.actor.DeathPactExceptionis thrown. It will be restarted for otherExceptiontypes. The error is escalated if it's aThrowable, i.e.Error. -
defaultStrategy
When supervisorStrategy is not specified for an actor this is used by default. OneForOneStrategy with decider defined indefaultDecider(). -
stoppingStrategy
This strategy resembles Erlang in that failing children are always terminated (one-for-one). -
seqThrowable2Decider
public scala.PartialFunction<Throwable,SupervisorStrategy.Directive> seqThrowable2Decider(scala.collection.immutable.Seq<Class<? extends Throwable>> trapExit) Implicit conversion fromSeqof Throwables to aDecider. This maps the given Throwables to restarts, otherwise escalates. -
makeDecider
public scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(scala.collection.immutable.Seq<Class<? extends Throwable>> trapExit) Decider builder which just checks whether one of the given Throwables matches the cause and restarts, otherwise escalates. -
makeDecider
public scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(Iterable<Class<? extends Throwable>> trapExit) Decider builder which just checks whether one of the given Throwables matches the cause and restarts, otherwise escalates. -
makeDecider
public scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(scala.collection.Iterable<scala.Tuple2<Class<? extends Throwable>, SupervisorStrategy.Directive>> flat) Decider builder for Iterables of cause-directive pairs, e.g. a map obtained from configuration; will sort the pairs so that the most specific type is checked before all its subtypes, allowing carving out subtrees of the Throwable hierarchy. -
makeDecider
public scala.PartialFunction<Throwable,SupervisorStrategy.Directive> makeDecider(Function<Throwable, SupervisorStrategy.Directive> func) Converts a Java Decider into a Scala Decider
-