Class Behaviors.Supervise<T>
java.lang.Object
org.apache.pekko.actor.typed.javadsl.Behaviors.Supervise<T>
- Enclosing class:
- Behaviors
-
Method Summary
Modifier and TypeMethodDescription<Thr extends Throwable>
SuperviseBehavior<T>onFailure(Class<Thr> clazz, SupervisorStrategy strategy) Specify theSupervisorStrategyto be invoked when the wrapped behavior throws.onFailure(SupervisorStrategy strategy) Specify theSupervisorStrategyto be invoked when the wrapped behavior throws.
-
Method Details
-
onFailure
public <Thr extends Throwable> SuperviseBehavior<T> onFailure(Class<Thr> clazz, SupervisorStrategy strategy) Specify theSupervisorStrategyto be invoked when the wrapped behavior throws.Only exceptions of the given type (and their subclasses) will be handled by this supervision behavior.
-
onFailure
Specify theSupervisorStrategyto be invoked when the wrapped behavior throws.All non-fatal (see
NonFatal) exceptions types will be handled using the given strategy.
-