Package akka.pattern

Class BackoffOptionsImpl

  • All Implemented Interfaces:
    BackoffOptions, java.io.Serializable, scala.Equals, scala.Product, scala.Serializable

    public final class BackoffOptionsImpl
    extends java.lang.Object
    implements BackoffOptions, scala.Product, scala.Serializable
    See Also:
    Serialized Form
    • Constructor Detail

      • BackoffOptionsImpl

        public BackoffOptionsImpl​(BackoffType backoffType,
                                  Props childProps,
                                  java.lang.String childName,
                                  scala.concurrent.duration.FiniteDuration minBackoff,
                                  scala.concurrent.duration.FiniteDuration maxBackoff,
                                  double randomFactor,
                                  scala.Option<BackoffReset> reset,
                                  OneForOneStrategy supervisorStrategy,
                                  scala.Option<java.lang.Object> replyWhileStopped,
                                  scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> finalStopMessage)
    • Method Detail

      • $lessinit$greater$default$1

        public static BackoffType $lessinit$greater$default$1()
      • $lessinit$greater$default$7

        public static scala.Option<BackoffReset> $lessinit$greater$default$7()
      • $lessinit$greater$default$8

        public static OneForOneStrategy $lessinit$greater$default$8()
      • $lessinit$greater$default$9

        public static scala.Option<java.lang.Object> $lessinit$greater$default$9()
      • $lessinit$greater$default$10

        public static scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> $lessinit$greater$default$10()
      • apply

        public static BackoffOptionsImpl apply​(BackoffType backoffType,
                                               Props childProps,
                                               java.lang.String childName,
                                               scala.concurrent.duration.FiniteDuration minBackoff,
                                               scala.concurrent.duration.FiniteDuration maxBackoff,
                                               double randomFactor,
                                               scala.Option<BackoffReset> reset,
                                               OneForOneStrategy supervisorStrategy,
                                               scala.Option<java.lang.Object> replyWhileStopped,
                                               scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> finalStopMessage)
      • apply$default$1

        public static BackoffType apply$default$1()
      • apply$default$10

        public static scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> apply$default$10()
      • apply$default$7

        public static scala.Option<BackoffReset> apply$default$7()
      • apply$default$9

        public static scala.Option<java.lang.Object> apply$default$9()
      • unapply

        public static scala.Option<scala.Tuple10<BackoffType,​Props,​java.lang.String,​scala.concurrent.duration.FiniteDuration,​scala.concurrent.duration.FiniteDuration,​java.lang.Object,​scala.Option<BackoffReset>,​OneForOneStrategy,​scala.Option<java.lang.Object>,​scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>>>> unapply​(BackoffOptionsImpl 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()
      • replyWhileStopped

        public scala.Option<java.lang.Object> replyWhileStopped()
      • finalStopMessage

        public scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> finalStopMessage()
      • withAutoReset

        public BackoffOptionsImpl withAutoReset​(scala.concurrent.duration.FiniteDuration resetBackoff)
        Description copied from interface: BackoffOptions
        Returns a new BackoffOptions with automatic back-off reset. The back-off algorithm is reset if the child does not crash within the specified resetBackoff.
        Specified by:
        withAutoReset in interface BackoffOptions
        Parameters:
        resetBackoff - The back-off is reset if the child does not crash within this duration.
        Returns:
        (undocumented)
      • withManualReset

        public BackoffOptionsImpl withManualReset()
        Description copied from interface: BackoffOptions
        Returns a new BackoffOptions with manual back-off reset. The back-off is only reset if the child sends a BackoffSupervisor.Reset to its parent (the backoff-supervisor actor).
        Specified by:
        withManualReset in interface BackoffOptions
        Returns:
        (undocumented)
      • withSupervisorStrategy

        public BackoffOptionsImpl withSupervisorStrategy​(OneForOneStrategy supervisorStrategy)
        Description copied from interface: BackoffOptions
        Returns a new BackoffOptions with the supervisorStrategy.
        Specified by:
        withSupervisorStrategy in interface BackoffOptions
        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 a OneForOneStrategy makes sense here. Note that changing the strategy will replace the previously defined maxNrOfRetries.
        Returns:
        (undocumented)
      • withDefaultStoppingStrategy

        public BackoffOptionsImpl withDefaultStoppingStrategy()
        Description copied from interface: BackoffOptions
        Returns a new BackoffOptions with a default SupervisorStrategy.stoppingStrategy. The default supervisor strategy is used as fallback for throwables not handled by SupervisorStrategy.stoppingStrategy.
        Specified by:
        withDefaultStoppingStrategy in interface BackoffOptions
        Returns:
        (undocumented)
      • withReplyWhileStopped

        public BackoffOptionsImpl withReplyWhileStopped​(java.lang.Object replyWhileStopped)
        Description copied from interface: BackoffOptions
        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 to deadLetters. With this option, the supervisor will reply to the sender instead.
        Specified by:
        withReplyWhileStopped in interface BackoffOptions
        Parameters:
        replyWhileStopped - The message that the supervisor will send in response to all messages while its child is stopped.
        Returns:
        (undocumented)
      • withMaxNrOfRetries

        public BackoffOptionsImpl withMaxNrOfRetries​(int maxNrOfRetries)
        Description copied from interface: BackoffOptions
        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 interface BackoffOptions
        Parameters:
        maxNrOfRetries - the number of times a child actor is allowed to be restarted, negative value means no limit, if the limit is exceeded the child actor is stopped
        Returns:
        (undocumented)
      • withFinalStopMessage

        public BackoffOptionsImpl withFinalStopMessage​(scala.Function1<java.lang.Object,​java.lang.Object> action)
        Description copied from interface: BackoffOptions
        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 interface BackoffOptions
        Parameters:
        action - (undocumented)
        Returns:
        (undocumented)
      • props

        public Props props()
        Description copied from interface: BackoffOptions
        Returns the props to create the back-off supervisor.
        Specified by:
        props in interface BackoffOptions
        Returns:
        (undocumented)
      • copy

        public BackoffOptionsImpl copy​(BackoffType backoffType,
                                       Props childProps,
                                       java.lang.String childName,
                                       scala.concurrent.duration.FiniteDuration minBackoff,
                                       scala.concurrent.duration.FiniteDuration maxBackoff,
                                       double randomFactor,
                                       scala.Option<BackoffReset> reset,
                                       OneForOneStrategy supervisorStrategy,
                                       scala.Option<java.lang.Object> replyWhileStopped,
                                       scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> finalStopMessage)
      • copy$default$10

        public scala.Option<scala.Function1<java.lang.Object,​java.lang.Object>> copy$default$10()
      • copy$default$2

        public Props copy$default$2()
      • copy$default$3

        public java.lang.String copy$default$3()
      • copy$default$4

        public scala.concurrent.duration.FiniteDuration copy$default$4()
      • copy$default$5

        public scala.concurrent.duration.FiniteDuration copy$default$5()
      • copy$default$6

        public double copy$default$6()
      • copy$default$7

        public scala.Option<BackoffReset> copy$default$7()
      • copy$default$9

        public scala.Option<java.lang.Object> copy$default$9()
      • productPrefix

        public java.lang.String productPrefix()
        Specified by:
        productPrefix in interface scala.Product
      • productArity

        public int productArity()
        Specified by:
        productArity in interface scala.Product
      • productElement

        public java.lang.Object productElement​(int x$1)
        Specified by:
        productElement in interface scala.Product
      • productIterator

        public scala.collection.Iterator<java.lang.Object> productIterator()
        Specified by:
        productIterator in interface scala.Product
      • canEqual

        public boolean canEqual​(java.lang.Object x$1)
        Specified by:
        canEqual in interface scala.Equals
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object x$1)
        Specified by:
        equals in interface scala.Equals
        Overrides:
        equals in class java.lang.Object