Class LivelockDetector.Builder

java.lang.Object
com.tnsai.coordination.choreography.LivelockDetector.Builder
Enclosing class:
LivelockDetector

public static final class LivelockDetector.Builder extends Object
Builder for LivelockDetector.
  • Method Details

    • repeatThreshold

      public LivelockDetector.Builder repeatThreshold(int threshold)
      Sets the number of identical messages within the repeat window that triggers a REPEATED_MESSAGE violation.
      Parameters:
      threshold - minimum repeat count (must be >= 2)
      Returns:
      this builder
    • repeatWindow

      public LivelockDetector.Builder repeatWindow(Duration window)
      Sets the time window for counting repeated messages.
      Parameters:
      window - time window (must be positive)
      Returns:
      this builder
    • oscillationThreshold

      public LivelockDetector.Builder oscillationThreshold(int threshold)
      Sets the number of alternating state changes that triggers an OSCILLATING_STATE violation.
      Parameters:
      threshold - minimum alternation count (must be >= 3)
      Returns:
      this builder
    • stallWindow

      public LivelockDetector.Builder stallWindow(Duration window)
      Sets the time window after which no new unique actions triggers a PROGRESS_STALL violation.
      Parameters:
      window - stall window (must be positive)
      Returns:
      this builder
    • circuitBreakerThreshold

      public LivelockDetector.Builder circuitBreakerThreshold(int threshold)
      Sets the total violation count that trips the circuit breaker.
      Parameters:
      threshold - circuit breaker threshold (must be >= 1)
      Returns:
      this builder
    • build

      public LivelockDetector build()
      Builds the LivelockDetector.
      Returns:
      configured detector