akka.actor

AllForOneStrategy

case class AllForOneStrategy(maxNrOfRetries: Int = -1, withinTimeRange: Duration = ..., loggingEnabled: Boolean = true)(decider: Decider) extends SupervisorStrategy with Product with Serializable

Applies the fault handling Directive (Resume, Restart, Stop) specified in the Decider to all children when one fails, as opposed to akka.actor.OneForOneStrategy that applies it only to the child actor that failed.

maxNrOfRetries

the number of times an actor is allowed to be restarted, negative value means no limit

withinTimeRange

duration of the time window for maxNrOfRetries, Duration.Inf means no window

loggingEnabled

the strategy logs the failure if this is enabled (true), by default it is enabled

decider

mapping from Throwable to akka.actor.SupervisorStrategy.Directive, you can also use a Seq of Throwables which maps the given Throwables to restarts, otherwise escalates.

Linear Supertypes
Serializable, Serializable, Product, Equals, SupervisorStrategy, AnyRef, Any
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. AllForOneStrategy
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. SupervisorStrategy
  7. AnyRef
  8. Any
Implicitly
  1. by any2stringadd
  2. by any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Duration, trapExit: Iterable[Class[_ <: Throwable]])

  2. new AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Duration, decider: JDecider)

  3. new AllForOneStrategy(maxNrOfRetries: Int, withinTimeRange: Duration, decider: JDecider, loggingEnabled: Boolean)

  4. new AllForOneStrategy(maxNrOfRetries: Int = -1, withinTimeRange: Duration = ..., loggingEnabled: Boolean = true)(decider: Decider)

    maxNrOfRetries

    the number of times an actor is allowed to be restarted, negative value means no limit

    withinTimeRange

    duration of the time window for maxNrOfRetries, Duration.Inf means no window

    loggingEnabled

    the strategy logs the failure if this is enabled (true), by default it is enabled

    decider

    mapping from Throwable to akka.actor.SupervisorStrategy.Directive, you can also use a Seq of Throwables which maps the given Throwables to restarts, otherwise escalates.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (AllForOneStrategy, B)

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to ArrowAssoc[AllForOneStrategy] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val decider: Decider

    mapping from Throwable to akka.actor.SupervisorStrategy.Directive, you can also use a Seq of Throwables which maps the given Throwables to restarts, otherwise escalates.

    mapping from Throwable to akka.actor.SupervisorStrategy.Directive, you can also use a Seq of Throwables which maps the given Throwables to restarts, otherwise escalates.

    Definition Classes
    AllForOneStrategySupervisorStrategy
  11. def ensuring(cond: (AllForOneStrategy) ⇒ Boolean, msg: ⇒ Any): AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to Ensuring[AllForOneStrategy] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: (AllForOneStrategy) ⇒ Boolean): AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to Ensuring[AllForOneStrategy] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean, msg: ⇒ Any): AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to Ensuring[AllForOneStrategy] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: Boolean): AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to Ensuring[AllForOneStrategy] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. def handleChildTerminated(context: ActorContext, child: ActorRef, children: Iterable[ActorRef]): Unit

    This method is called after the child has been removed from the set of children.

    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.

    Definition Classes
    AllForOneStrategySupervisorStrategy
  20. def handleFailure(context: ActorContext, child: ActorRef, cause: Throwable, stats: ChildRestartStats, children: Iterable[ChildRestartStats]): Boolean

    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 returning true), or it returns false to escalate the failure, which will lead to this actor re-throwing the exception which caused the failure.

    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 returning true), or it returns false 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 akka.actor.SupervisorStrategy#logFailure, which will log the failure unless it is escalated. You can customize the logging by setting akka.actor.SupervisorStrategy#loggingEnabled to false and do the logging inside the decider or override the logFailure method.

    children

    is a lazy collection (a view)

    Definition Classes
    SupervisorStrategy
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. def logFailure(context: ActorContext, child: ActorRef, cause: Throwable, decision: Directive): Unit

    Default logging of actor failures when akka.actor.SupervisorStrategy#loggingEnabled is true.

    Default logging of actor failures when akka.actor.SupervisorStrategy#loggingEnabled is true. Escalate failures are not logged here, since they are supposed to be handled at a level higher up in the hierarchy. Resume failures are logged at Warning level. Stop and Restart failures are logged at Error level.

    Attributes
    protected
    Definition Classes
    SupervisorStrategy
  23. val loggingEnabled: Boolean

    the strategy logs the failure if this is enabled (true), by default it is enabled

    the strategy logs the failure if this is enabled (true), by default it is enabled

    Definition Classes
    AllForOneStrategySupervisorStrategy
  24. val maxNrOfRetries: Int

    the number of times an actor is allowed to be restarted, negative value means no limit

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. def processFailure(context: ActorContext, restart: Boolean, child: ActorRef, cause: Throwable, stats: ChildRestartStats, children: Iterable[ChildRestartStats]): Unit

    This method is called to act on the failure of a child: restart if the flag is true, stop otherwise.

    This method is called to act on the failure of a child: restart if the flag is true, stop otherwise.

    Definition Classes
    AllForOneStrategySupervisorStrategy
  29. final def restartChild(child: ActorRef, cause: Throwable, suspendFirst: Boolean): Unit

    Restart the given child, possibly suspending it first.

    Restart the given child, possibly suspending it first.

    IMPORTANT:

    If the child is the currently failing one, it will already have been suspended, hence suspendFirst must be false. If the child is not the currently failing one, then it did not request this treatment and is therefore not prepared to be resumed without prior suspend.

    Definition Classes
    SupervisorStrategy
  30. final def resumeChild(child: ActorRef, cause: Throwable): Unit

    Resume the previously failed child: do never apply this to a child which is not the currently failing child.

    Resume the previously failed child: do never apply this to a child which is not the currently failing child. Suspend/resume needs to be done in matching pairs, otherwise actors will wake up too soon or never at all.

    Definition Classes
    SupervisorStrategy
  31. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  32. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. val withinTimeRange: Duration

    duration of the time window for maxNrOfRetries, Duration.

    duration of the time window for maxNrOfRetries, Duration.Inf means no window

  36. def [B](y: B): (AllForOneStrategy, B)

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to ArrowAssoc[AllForOneStrategy] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (allForOneStrategy: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (allForOneStrategy: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to ArrowAssoc[AllForOneStrategy] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (allForOneStrategy: ArrowAssoc[AllForOneStrategy]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: AllForOneStrategy

    Implicit information
    This member is added by an implicit conversion from AllForOneStrategy to Ensuring[AllForOneStrategy] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (allForOneStrategy: Ensuring[AllForOneStrategy]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from SupervisorStrategy

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from AllForOneStrategy to StringAdd

Inherited by implicit conversion any2stringfmt from AllForOneStrategy to StringFormat

Inherited by implicit conversion any2ArrowAssoc from AllForOneStrategy to ArrowAssoc[AllForOneStrategy]

Inherited by implicit conversion any2Ensuring from AllForOneStrategy to Ensuring[AllForOneStrategy]

Ungrouped