nl.grons.sentries.support

ComposingSentryBuilder

class ComposingSentryBuilder extends SentryBuilder with ChainableSentry

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ComposingSentryBuilder
  2. ChainableSentry
  3. NamedSentry
  4. Sentry
  5. SentryBuilder
  6. AnyRef
  7. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ComposingSentryBuilder (owner: Class[_], resourceName: String, sentryRegistry: SentriesRegistry, sentry: Sentry)

Value Members

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

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

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

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  6. def andThen (s: Sentry): Sentry

    Composes two instances of Sentry in a new Sentry, with this sentries context applied first.

    Composes two instances of Sentry in a new Sentry, with this sentries context applied first.

    returns

    a new sentry t such that t(x) == s(this(x))

    Definition Classes
    Sentry
  7. def apply [T] (r: ⇒ T): T

    Run the given code block in the context of this sentry, and return its value.

    Run the given code block in the context of this sentry, and return its value.

    Definition Classes
    ComposingSentryBuilderSentry
  8. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  9. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def compose (s: Sentry): Sentry

    Composes two instances of Sentry in a new Sentry, with this sentries context applied last.

    Composes two instances of Sentry in a new Sentry, with this sentries context applied last.

    returns

    a new sentry t such that t(x) == this(s(x))

    Definition Classes
    Sentry
  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  14. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  15. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  16. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  17. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  19. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  20. def registered (sentry: ChainableSentry): ChainableSentry

    Returns the registered instance of the sentry (when applicable).

    Returns the registered instance of the sentry (when applicable).

    Attributes
    protected
    Definition Classes
    SentryBuilder
  21. def reset (): Unit

    Go back to the initial state.

    Go back to the initial state.

    Definition Classes
    ComposingSentryBuilderSentry
  22. val sentry : Sentry

  23. def sentryType : Null

    returns

    a simple describing identifier that is unique per sentry chain, e.g. "rateLimit". ResourceName plus sentryType uniquely name each sentry. The sentry registry enforces this. The sentryType is also used in JMX to uniquely name bean properties for a resource. null for sentry wrappers, that must not be registered.

    Definition Classes
    ComposingSentryBuilderChainableSentry
  24. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  25. def toString (): String

    Definition Classes
    AnyRef → Any
  26. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. def withAdaptiveThroughput (targetSuccessRatio: Double = 0.95D, evaluationDelay: Duration = Duration(1, TimeUnit.SECONDS), minimumInvocationCountThreshold: Int = 0, successIncreaseFactor: Double = 1.2D): ChainableSentry with SentryBuilder

    Append an adaptive throughput sentry to the current sentry.

    Append an adaptive throughput sentry to the current sentry. See AdaptiveThroughputSentry for more information.

    targetSuccessRatio

    target success ratio, 0 < targetSuccessRatio < 1, defaults to 0.95

    evaluationDelay

    the time between calculations of the current throughput, defaults to 1 second

    minimumInvocationCountThreshold

    the minimum number of invocations that must be observed per evaluationDelay before invocations are throttled, defaults to 0

    successIncreaseFactor

    factor to apply to current throughput ratio, successIncreaseFactor > 1, defaults to 1.2D

    returns

    a new sentry that adaptively changes allowed throughput after the current sentry behavior

    Definition Classes
    SentryBuilder
  30. def withConcurrencyLimit (concurrencyLimit: Int): ChainableSentry with SentryBuilder

    Append a concurrency limit sentry to the current sentry.

    Append a concurrency limit sentry to the current sentry.

    concurrencyLimit

    number of concurrently allowed invocations

    returns

    a new sentry that applies a concurrency limit after the current sentry behavior

    Definition Classes
    SentryBuilder
  31. def withDurationLimit (durationLimit: Duration): ChainableSentry with SentryBuilder

    Append a invocation duration limit sentry to the current sentry.

    Append a invocation duration limit sentry to the current sentry.

    WARNING: do NOT use this sentry when you invoke it from a Future or an Actor. For such circumstances you are MUCH better of with a timeout on the enclosing future or a timeout message within the actor. Reason: this sentry blocks the current thread while waiting on a future that executes the task. Blocking the current thread is an anti-pattern for futures and actors.

    durationLimit

    the maximum duration of a call

    returns

    a new sentry that applies a duration limit after the current sentry behavior

    Definition Classes
    SentryBuilder
  32. def withFailLimit (failLimit: Int, retryDelay: Duration = Duration(1, TimeUnit.SECONDS)): ChainableSentry with SentryBuilder

    Append a circuit breaker sentry to the current sentry.

    Append a circuit breaker sentry to the current sentry. See CircuitBreakerSentry for more information.

    failLimit

    number of failure after which the flow will be broken

    retryDelay

    timeout for trying again, defaults to 1 second

    returns

    a new sentry that applies a circuit breaker after the current sentry behavior

    Definition Classes
    SentryBuilder
  33. def withFailLimitAndAdaptiveThroughput (failLimit: Int, retryDelay: Duration = Duration(1, TimeUnit.SECONDS), targetSuccessRatio: Double = 0.95D): ChainableSentry with SentryBuilder

    Append a circuit breaker AND an adaptive throughput sentry to the current sentry.

    Append a circuit breaker AND an adaptive throughput sentry to the current sentry. See CircuitBreakerSentry and AdaptiveThroughputSentry for more information.

    failLimit

    number of failure after which the flow will be broken by circuit breaker, AND the minimum number of invocations before throttling takes place in the adaptive throughput

    retryDelay

    timeout for trying again (> 5 milliseconds), defaults to 1 second

    targetSuccessRatio

    target success ratio for adaptive throughput, 0 < targetSuccessRatio < 1, defaults to 0.95

    returns

    a new sentry that applies adaptive throughput after a circuit breaker after the current sentry behavior

    Definition Classes
    SentryBuilder
  34. def withMetrics : ChainableSentry with SentryBuilder

    Append a metric sentry to the current sentry.

    Append a metric sentry to the current sentry.

    One timer and 2 meter metrics are registered: "all", "fail" and "notAvailable". The "all" timer times and counts all invocations, the "fail" meter counts invocations that threw an exception, and the "notAvailable" meter counts invocations that were blocked by a sentry that is later in the chain (detected by catching NotAvailableExceptions).

    When only a timer is needed, use .withTimer instead.

    To count the 'not available' invocations, this must be the first sentry in the chain.

    For more information see MetricSentry.

    returns

    a new sentry that collects metrics after the current sentry behavior

    Definition Classes
    SentryBuilder
  35. def withRateLimit (rate: Int, per: Duration): ChainableSentry with SentryBuilder

    Append a rate limit sentry to the current sentry.

    Append a rate limit sentry to the current sentry.

    rate

    number of invocations per time unit

    per

    the time unit

    returns

    a new sentry that applies a concurrency limit after the current sentry behavior

    Definition Classes
    SentryBuilder
  36. def withSentry (composeSentry: ChainableSentry): ComposingSentryBuilder

    Append a custom sentry to the current sentry.

    Append a custom sentry to the current sentry.

    returns

    a new sentry that applies the given sentry after the current sentry behavior

    Definition Classes
    ComposingSentryBuilderSentryBuilder
  37. def withTimer : ChainableSentry with SentryBuilder

    Append a timer sentry to the current sentry.

    Append a timer sentry to the current sentry.

    One timer is registered: "all". It is updated for each invocation. For more extensive measuring, use .withMetrics instead.

    For more information see TimerSentry.

    returns

    a new sentry that collects metrics after the current sentry behavior

    Definition Classes
    SentryBuilder

Inherited from ChainableSentry

Inherited from NamedSentry

Inherited from Sentry

Inherited from SentryBuilder

Inherited from AnyRef

Inherited from Any