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. final def !=(arg0: AnyRef): Boolean

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

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

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

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

    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. final def asInstanceOf[T0]: T0

    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. final def eq(arg0: AnyRef): Boolean

    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. final def getClass(): java.lang.Class[_]

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

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

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

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

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

    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. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  25. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws()
  29. def withAdaptiveThroughput(targetSuccessRatio: Double = 0.95D): 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

    returns

    a new sentry that adaptively changes allowed throughput on top of 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 1) a akka.dispatch.Future or 2) an akka.actor.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): ChainableSentry with SentryBuilder

    Append a circuit breaker sentry to the current sentry.

    Append a circuit breaker sentry to the current sentry.

    failLimit

    number of failure after which the flow will be broken

    retryDelay

    timeout for trying again

    returns

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

    Definition Classes
    SentryBuilder
  33. def withFullMetrics: ChainableSentry with SentryBuilder

    Append an extensive metrics sentry to the current sentry.

    Append an extensive metrics sentry to the current sentry.

    Four timers are registered: "all", "success", "fail" and "notAvailable". These are update for respectively each invocation, succeeding invocations, invocations that throw an exception, and invocations that are blocked by a sentry that is later in the chain (detected by catching NotAvailableExceptions).

    When 4 timers is too much detail, use .withMetrics instead.

    returns

    a new sentry that collects metrics after the current sentry behavior

    Definition Classes
    SentryBuilder
  34. def withMetrics: ChainableSentry with SentryBuilder

    Append a metrics sentry to the current sentry.

    Append a metrics sentry to the current sentry.

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

    returns

    a new sentry that collects metrics after the current sentry behavior

    Definition Classes
    SentryBuilder
  35. def withRateLimit(rate: Int, per: Long): 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 in millis

    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

Inherited from ChainableSentry

Inherited from NamedSentry

Inherited from Sentry

Inherited from SentryBuilder

Inherited from AnyRef

Inherited from Any