public static class TestActor.DelegatingSupervisorStrategy extends SupervisorStrategy
SupervisorStrategy.Directive, SupervisorStrategy.Escalate$, SupervisorStrategy.Restart$, SupervisorStrategy.Resume$, SupervisorStrategy.Stop$
Constructor and Description |
---|
DelegatingSupervisorStrategy() |
Modifier and Type | Method and 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 returning
true ), or it returns false 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) |
defaultDecider, defaultStrategy, escalate, escalateDefault, logFailure, loggingEnabled, makeDecider, makeDecider, makeDecider, makeDecider, maxNrOfRetriesOption, restart, restartChild, resume, resumeChild, seqThrowable2Decider, sort, stop, stoppingStrategy, withinTimeRangeOption
public void update(ActorRef child, SupervisorStrategy supervisor)
public scala.PartialFunction<java.lang.Throwable,SupervisorStrategy.Directive> decider()
SupervisorStrategy
handleFailure
to obtain the Directive to be applied.decider
in class SupervisorStrategy
public void handleChildTerminated(ActorContext context, ActorRef child, scala.collection.Iterable<ActorRef> children)
SupervisorStrategy
handleChildTerminated
in class SupervisorStrategy
context
- (undocumented)child
- (undocumented)children
- (undocumented)public void processFailure(ActorContext context, boolean restart, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
SupervisorStrategy
processFailure
in class SupervisorStrategy
context
- (undocumented)restart
- (undocumented)child
- (undocumented)cause
- (undocumented)stats
- (undocumented)children
- (undocumented)public boolean handleFailure(ActorContext context, ActorRef child, java.lang.Throwable cause, ChildRestartStats stats, scala.collection.Iterable<ChildRestartStats> children)
SupervisorStrategy
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 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
setting SupervisorStrategy.loggingEnabled()
to false
and
do the logging inside the decider
or override the logFailure
method.
handleFailure
in class SupervisorStrategy
context
- (undocumented)cause
- (undocumented)stats
- (undocumented)children
- is a lazy collection (a view)