Package akka.actor.typed
Class SupervisorStrategy.Restart
- java.lang.Object
-
- akka.actor.typed.SupervisorStrategy
-
- akka.actor.typed.RestartSupervisorStrategy
-
- akka.actor.typed.SupervisorStrategy.Restart
-
- All Implemented Interfaces:
SupervisorStrategy.RestartOrBackoff
,java.io.Serializable
,scala.Equals
,scala.Product
,scala.Serializable
- Enclosing class:
- SupervisorStrategy
public static final class SupervisorStrategy.Restart extends RestartSupervisorStrategy implements SupervisorStrategy.RestartOrBackoff, scala.Product, scala.Serializable
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class akka.actor.typed.SupervisorStrategy
SupervisorStrategy.Backoff, SupervisorStrategy.Backoff$, SupervisorStrategy.Restart, SupervisorStrategy.Restart$, SupervisorStrategy.RestartOrBackoff, SupervisorStrategy.Resume, SupervisorStrategy.Resume$, SupervisorStrategy.Stop, SupervisorStrategy.Stop$
-
-
Constructor Summary
Constructors Constructor Description Restart(int maxRestarts, scala.concurrent.duration.FiniteDuration withinTimeRange, boolean loggingEnabled, boolean stopChildren, int stashCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canEqual(java.lang.Object x$1)
SupervisorStrategy.Restart
copy(int maxRestarts, scala.concurrent.duration.FiniteDuration withinTimeRange, boolean loggingEnabled, boolean stopChildren, int stashCapacity)
int
copy$default$1()
scala.concurrent.duration.FiniteDuration
copy$default$2()
boolean
copy$default$3()
boolean
copy$default$4()
int
copy$default$5()
boolean
equals(java.lang.Object x$1)
int
hashCode()
boolean
loggingEnabled()
int
maxRestarts()
int
productArity()
java.lang.Object
productElement(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
int
stashCapacity()
boolean
stopChildren()
java.lang.String
toString()
scala.concurrent.duration.FiniteDuration
withinTimeRange()
RestartSupervisorStrategy
withLimit(int maxNrOfRetries, java.time.Duration withinTimeRange)
Java API: Restart with a limit of number of restart retries.RestartSupervisorStrategy
withLimit(int maxNrOfRetries, scala.concurrent.duration.FiniteDuration withinTimeRange)
RestartSupervisorStrategy
withLoggingEnabled(boolean enabled)
RestartSupervisorStrategy
withStashCapacity(int capacity)
While restarting (waiting for children to stop) incoming messages and signals are stashed, and delivered later to the newly restarted behavior.RestartSupervisorStrategy
withStopChildren(boolean enabled)
Stop or keep child actors when the parent actor is restarted.-
Methods inherited from class akka.actor.typed.SupervisorStrategy
restart, restartWithBackoff, restartWithBackoff, resume, stop
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface akka.actor.typed.SupervisorStrategy.RestartOrBackoff
unlimitedRestarts
-
-
-
-
Method Detail
-
maxRestarts
public int maxRestarts()
- Specified by:
maxRestarts
in interfaceSupervisorStrategy.RestartOrBackoff
-
withinTimeRange
public scala.concurrent.duration.FiniteDuration withinTimeRange()
-
loggingEnabled
public boolean loggingEnabled()
- Specified by:
loggingEnabled
in interfaceSupervisorStrategy.RestartOrBackoff
- Specified by:
loggingEnabled
in classSupervisorStrategy
-
stopChildren
public boolean stopChildren()
- Specified by:
stopChildren
in interfaceSupervisorStrategy.RestartOrBackoff
-
stashCapacity
public int stashCapacity()
- Specified by:
stashCapacity
in interfaceSupervisorStrategy.RestartOrBackoff
-
withLimit
public RestartSupervisorStrategy withLimit(int maxNrOfRetries, scala.concurrent.duration.FiniteDuration withinTimeRange)
- Specified by:
withLimit
in classRestartSupervisorStrategy
-
withLimit
public RestartSupervisorStrategy withLimit(int maxNrOfRetries, java.time.Duration withinTimeRange)
Description copied from class:RestartSupervisorStrategy
Java API: Restart with a limit of number of restart retries. The number of restarts are limited to a number of restart attempts (maxNrOfRetries
) within a time range (withinTimeRange
). When the time window has elapsed without reachingmaxNrOfRetries
the restart count is reset.The strategy is applied also if the actor behavior is deferred and throws an exception during startup.
- Specified by:
withLimit
in classRestartSupervisorStrategy
- Parameters:
maxNrOfRetries
- the number of times a child actor is allowed to be restarted, if the limit is exceeded the child actor is stoppedwithinTimeRange
- duration of the time window for maxNrOfRetries- Returns:
- (undocumented)
-
withStopChildren
public RestartSupervisorStrategy withStopChildren(boolean enabled)
Description copied from class:RestartSupervisorStrategy
Stop or keep child actors when the parent actor is restarted. By default child actors are stopped when parent is restarted.- Specified by:
withStopChildren
in classRestartSupervisorStrategy
- Parameters:
enabled
- iftrue
then child actors are stopped, otherwise they are kept- Returns:
- (undocumented)
-
withStashCapacity
public RestartSupervisorStrategy withStashCapacity(int capacity)
Description copied from class:RestartSupervisorStrategy
While restarting (waiting for children to stop) incoming messages and signals are stashed, and delivered later to the newly restarted behavior. This property defines the capacity in number of messages of the stash buffer. If the capacity is exceed then additional incoming messages are dropped.By default the capacity is defined by config property
akka.actor.typed.restart-stash-capacity
.- Specified by:
withStashCapacity
in classRestartSupervisorStrategy
- Parameters:
capacity
- (undocumented)- Returns:
- (undocumented)
-
withLoggingEnabled
public RestartSupervisorStrategy withLoggingEnabled(boolean enabled)
- Specified by:
withLoggingEnabled
in classRestartSupervisorStrategy
-
copy
public SupervisorStrategy.Restart copy(int maxRestarts, scala.concurrent.duration.FiniteDuration withinTimeRange, boolean loggingEnabled, boolean stopChildren, int stashCapacity)
-
copy$default$1
public int copy$default$1()
-
copy$default$2
public scala.concurrent.duration.FiniteDuration copy$default$2()
-
copy$default$3
public boolean copy$default$3()
-
copy$default$4
public boolean copy$default$4()
-
copy$default$5
public int copy$default$5()
-
productPrefix
public java.lang.String productPrefix()
- Specified by:
productPrefix
in interfacescala.Product
-
productArity
public int productArity()
- Specified by:
productArity
in interfacescala.Product
-
productElement
public java.lang.Object productElement(int x$1)
- Specified by:
productElement
in interfacescala.Product
-
productIterator
public scala.collection.Iterator<java.lang.Object> productIterator()
- Specified by:
productIterator
in interfacescala.Product
-
canEqual
public boolean canEqual(java.lang.Object x$1)
- Specified by:
canEqual
in interfacescala.Equals
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object x$1)
- Specified by:
equals
in interfacescala.Equals
- Overrides:
equals
in classjava.lang.Object
-
-