nl.grons.sentries.support

ComposingSentryBuilder

class ComposingSentryBuilder extends SentryBuilder with ChainableSentry

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

Instance Constructors

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

Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Definition Classes
    AnyRef → Any
  4. 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
  5. 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
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. 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
  9. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

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

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

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

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

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

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

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

    Definition Classes
    AnyRef
  18. 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
  19. def reset(): Unit

    Go back to the initial state.

    Go back to the initial state.

    Definition Classes
    ComposingSentryBuilderSentry
  20. val resourceName: String

    Definition Classes
    SentryBuilder
  21. val sentry: Sentry

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

    Definition Classes
    AnyRef
  24. def toString(): String

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

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. 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 nl.grons.sentries.core.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 (>=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
  29. 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
  30. 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
  31. 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 nl.grons.sentries.core.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
  32. 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 nl.grons.sentries.core.CircuitBreakerSentry and nl.grons.sentries.core.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
  33. 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 nl.grons.sentries.support.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 nl.grons.sentries.core.MetricSentry.

    returns

    a new sentry that collects metrics after the current sentry behavior

    Definition Classes
    SentryBuilder
  34. 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
  35. 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
  36. 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 nl.grons.sentries.core.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

Ungrouped