Class Behaviors.Supervise<T>

  • Enclosing class:
    Behaviors

    public static final class Behaviors.Supervise<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Supervise​(Behavior<T> wrapped)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Behavior<T> onFailure​(SupervisorStrategy strategy)
      Specify the SupervisorStrategy to be invoked when the wrapped behaior throws.
      <Thr extends java.lang.Throwable>
      Behavior<T>
      onFailure​(java.lang.Class<Thr> clazz, SupervisorStrategy strategy)
      Specify the SupervisorStrategy to be invoked when the wrapped behavior throws.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Supervise

        public Supervise​(Behavior<T> wrapped)
    • Method Detail

      • onFailure

        public <Thr extends java.lang.Throwable> Behavior<T> onFailure​(java.lang.Class<Thr> clazz,
                                                                       SupervisorStrategy strategy)
        Specify the SupervisorStrategy to be invoked when the wrapped behavior throws.

        Only exceptions of the given type (and their subclasses) will be handled by this supervision behavior.

        Parameters:
        clazz - (undocumented)
        strategy - (undocumented)
        Returns:
        (undocumented)
      • onFailure

        public Behavior<T> onFailure​(SupervisorStrategy strategy)
        Specify the SupervisorStrategy to be invoked when the wrapped behaior throws.

        All non-fatal (see NonFatal) exceptions types will be handled using the given strategy.

        Parameters:
        strategy - (undocumented)
        Returns:
        (undocumented)