Package akka.pattern
Class BackoffOnStopOptionsImpl<T>
- java.lang.Object
-
- akka.pattern.BackoffOnStopOptionsImpl<T>
-
- All Implemented Interfaces:
BackoffOnStopOptions
,ExtendedBackoffOptions<BackoffOnStopOptions>
,java.io.Serializable
,scala.Equals
,scala.Product
public final class BackoffOnStopOptionsImpl<T> extends java.lang.Object implements BackoffOnStopOptions, scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BackoffOnStopOptionsImpl(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> scala.Option<BackoffReset>
$lessinit$greater$default$6()
static <T> OneForOneStrategy
$lessinit$greater$default$7()
static <T> HandlingWhileStopped
$lessinit$greater$default$8()
static <T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>
$lessinit$greater$default$9()
static <T> BackoffOnStopOptionsImpl<T>
apply(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
static <T> scala.Option<BackoffReset>
apply$default$6()
static <T> OneForOneStrategy
apply$default$7()
static <T> HandlingWhileStopped
apply$default$8()
static <T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>
apply$default$9()
boolean
canEqual(java.lang.Object x$1)
java.lang.String
childName()
Props
childProps()
<T> BackoffOnStopOptionsImpl<T>
copy(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
<T> Props
copy$default$1()
<T> java.lang.String
copy$default$2()
<T> scala.concurrent.duration.FiniteDuration
copy$default$3()
<T> scala.concurrent.duration.FiniteDuration
copy$default$4()
<T> double
copy$default$5()
<T> scala.Option<BackoffReset>
copy$default$6()
<T> OneForOneStrategy
copy$default$7()
<T> HandlingWhileStopped
copy$default$8()
<T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>
copy$default$9()
boolean
equals(java.lang.Object x$1)
scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>
finalStopMessage()
HandlingWhileStopped
handlingWhileStopped()
int
hashCode()
scala.concurrent.duration.FiniteDuration
maxBackoff()
scala.concurrent.duration.FiniteDuration
minBackoff()
int
productArity()
java.lang.Object
productElement(int x$1)
java.lang.String
productElementName(int x$1)
scala.collection.Iterator<java.lang.Object>
productIterator()
java.lang.String
productPrefix()
Props
props()
Returns the props to create the back-off supervisor.double
randomFactor()
scala.Option<BackoffReset>
reset()
OneForOneStrategy
supervisorStrategy()
java.lang.String
toString()
static <T> scala.Option<scala.Tuple9<Props,java.lang.String,scala.concurrent.duration.FiniteDuration,scala.concurrent.duration.FiniteDuration,java.lang.Object,scala.Option<BackoffReset>,OneForOneStrategy,HandlingWhileStopped,scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>>>
unapply(BackoffOnStopOptionsImpl<T> x$0)
BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withAutoReset(scala.concurrent.duration.FiniteDuration resetBackoff)
Returns a new BackoffOptions with automatic back-off reset.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withDefaultStoppingStrategy()
Returns a new BackoffOptions with a defaultSupervisorStrategy.stoppingStrategy
.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withFinalStopMessage(scala.Function1<java.lang.Object,java.lang.Object> action)
Predicate evaluated for each message, if it returns true and the supervised actor is stopped then the supervisor will stop its self.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withHandlerWhileStopped(ActorRef handlerWhileStopped)
Returns a new BackoffOptions with a custom handler for messages that the supervisor receives while its child is stopped.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withManualReset()
Returns a new BackoffOptions with manual back-off reset.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withMaxNrOfRetries(int maxNrOfRetries)
Returns a new BackoffOptions with a maximum number of retries to restart the child actor.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withReplyWhileStopped(java.lang.Object replyWhileStopped)
Returns a new BackoffOptions with a constant reply to messages that the supervisor receives while its child is stopped.BackoffOnStopOptionsImpl<scala.runtime.Nothing$>
withSupervisorStrategy(OneForOneStrategy supervisorStrategy)
Returns a new BackoffOptions with the supervisorStrategy.
-
-
-
Constructor Detail
-
BackoffOnStopOptionsImpl
public BackoffOnStopOptionsImpl(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
-
-
Method Detail
-
$lessinit$greater$default$6
public static <T> scala.Option<BackoffReset> $lessinit$greater$default$6()
-
$lessinit$greater$default$7
public static <T> OneForOneStrategy $lessinit$greater$default$7()
-
$lessinit$greater$default$8
public static <T> HandlingWhileStopped $lessinit$greater$default$8()
-
$lessinit$greater$default$9
public static <T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> $lessinit$greater$default$9()
-
apply
public static <T> BackoffOnStopOptionsImpl<T> apply(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
-
apply$default$6
public static <T> scala.Option<BackoffReset> apply$default$6()
-
apply$default$7
public static <T> OneForOneStrategy apply$default$7()
-
apply$default$8
public static <T> HandlingWhileStopped apply$default$8()
-
apply$default$9
public static <T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> apply$default$9()
-
unapply
public static <T> scala.Option<scala.Tuple9<Props,java.lang.String,scala.concurrent.duration.FiniteDuration,scala.concurrent.duration.FiniteDuration,java.lang.Object,scala.Option<BackoffReset>,OneForOneStrategy,HandlingWhileStopped,scala.Option<scala.Function1<java.lang.Object,java.lang.Object>>>> unapply(BackoffOnStopOptionsImpl<T> x$0)
-
childProps
public Props childProps()
-
childName
public java.lang.String childName()
-
minBackoff
public scala.concurrent.duration.FiniteDuration minBackoff()
-
maxBackoff
public scala.concurrent.duration.FiniteDuration maxBackoff()
-
randomFactor
public double randomFactor()
-
reset
public scala.Option<BackoffReset> reset()
-
supervisorStrategy
public OneForOneStrategy supervisorStrategy()
-
handlingWhileStopped
public HandlingWhileStopped handlingWhileStopped()
-
finalStopMessage
public scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage()
-
withAutoReset
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withAutoReset(scala.concurrent.duration.FiniteDuration resetBackoff)
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with automatic back-off reset. The back-off algorithm is reset if the child does not crash within the specifiedresetBackoff
.- Specified by:
withAutoReset
in interfaceExtendedBackoffOptions<T>
- Parameters:
resetBackoff
- The back-off is reset if the child does not crash within this duration.
-
withManualReset
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withManualReset()
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with manual back-off reset. The back-off is only reset if the child sends aBackoffSupervisor.Reset
to its parent (the backoff-supervisor actor).- Specified by:
withManualReset
in interfaceExtendedBackoffOptions<T>
-
withSupervisorStrategy
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withSupervisorStrategy(OneForOneStrategy supervisorStrategy)
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with the supervisorStrategy.- Specified by:
withSupervisorStrategy
in interfaceExtendedBackoffOptions<T>
- Parameters:
supervisorStrategy
- the supervisorStrategy that the back-off supervisor will use. The default supervisor strategy is used as fallback if the specified supervisorStrategy (its decider) does not explicitly handle an exception. As the BackoffSupervisor creates a separate actor to handle the backoff process, only aOneForOneStrategy
makes sense here. Note that changing the strategy will replace the previously defined maxNrOfRetries.
-
withReplyWhileStopped
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withReplyWhileStopped(java.lang.Object replyWhileStopped)
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with a constant reply to messages that the supervisor receives while its child is stopped. By default, a message received while the child is stopped is forwarded todeadLetters
. With this option, the supervisor will reply to the sender instead.- Specified by:
withReplyWhileStopped
in interfaceExtendedBackoffOptions<T>
- Parameters:
replyWhileStopped
- The message that the supervisor will send in response to all messages while its child is stopped.
-
withHandlerWhileStopped
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withHandlerWhileStopped(ActorRef handlerWhileStopped)
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with a custom handler for messages that the supervisor receives while its child is stopped. By default, a message received while the child is stopped is forwarded todeadLetters
. Essentially, this handler replacesdeadLetters
allowing to implement custom handling instead of a static reply.- Specified by:
withHandlerWhileStopped
in interfaceExtendedBackoffOptions<T>
- Parameters:
handlerWhileStopped
- PartialFunction of the received message and sender
-
withMaxNrOfRetries
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withMaxNrOfRetries(int maxNrOfRetries)
Description copied from interface:ExtendedBackoffOptions
Returns a new BackoffOptions with a maximum number of retries to restart the child actor. By default, the supervisor will retry infinitely. With this option, the supervisor will terminate itself after the maxNoOfRetries is reached.- Specified by:
withMaxNrOfRetries
in interfaceExtendedBackoffOptions<T>
- Parameters:
maxNrOfRetries
- the number of times a child actor is allowed to be restarted. If negative, the value is unbounded, otherwise the provided limit is used. If the limit is exceeded the child actor will be stopped.
-
withDefaultStoppingStrategy
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withDefaultStoppingStrategy()
Description copied from interface:BackoffOnStopOptions
Returns a new BackoffOptions with a defaultSupervisorStrategy.stoppingStrategy
. The default supervisor strategy is used as fallback for throwables not handled bySupervisorStrategy.stoppingStrategy
.- Specified by:
withDefaultStoppingStrategy
in interfaceBackoffOnStopOptions
-
withFinalStopMessage
public BackoffOnStopOptionsImpl<scala.runtime.Nothing$> withFinalStopMessage(scala.Function1<java.lang.Object,java.lang.Object> action)
Description copied from interface:BackoffOnStopOptions
Predicate evaluated for each message, if it returns true and the supervised actor is stopped then the supervisor will stop its self. If it returns true while the supervised actor is running then it will be forwarded to the supervised actor and when the supervised actor stops its self the supervisor will stop its self.- Specified by:
withFinalStopMessage
in interfaceBackoffOnStopOptions
-
props
public Props props()
Description copied from interface:ExtendedBackoffOptions
Returns the props to create the back-off supervisor.- Specified by:
props
in interfaceExtendedBackoffOptions<T>
-
copy
public <T> BackoffOnStopOptionsImpl<T> copy(Props childProps, java.lang.String childName, scala.concurrent.duration.FiniteDuration minBackoff, scala.concurrent.duration.FiniteDuration maxBackoff, double randomFactor, scala.Option<BackoffReset> reset, OneForOneStrategy supervisorStrategy, HandlingWhileStopped handlingWhileStopped, scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> finalStopMessage)
-
copy$default$1
public <T> Props copy$default$1()
-
copy$default$2
public <T> java.lang.String copy$default$2()
-
copy$default$3
public <T> scala.concurrent.duration.FiniteDuration copy$default$3()
-
copy$default$4
public <T> scala.concurrent.duration.FiniteDuration copy$default$4()
-
copy$default$5
public <T> double copy$default$5()
-
copy$default$6
public <T> scala.Option<BackoffReset> copy$default$6()
-
copy$default$7
public <T> OneForOneStrategy copy$default$7()
-
copy$default$8
public <T> HandlingWhileStopped copy$default$8()
-
copy$default$9
public <T> scala.Option<scala.Function1<java.lang.Object,java.lang.Object>> copy$default$9()
-
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
-
productElementName
public java.lang.String productElementName(int x$1)
- Specified by:
productElementName
in interfacescala.Product
-
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
-
-