Package org.apache.synapse.commons.throttle.core

# Class DistributedCounterException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.synapse.commons.throttle.core.DistributedCounterException

All Implemented Interfaces:
  `Serializable`

public class DistributedCounterException extends RuntimeException
Unchecked exception thrown by `DistributedCounterManager` operations. Carries a `DistributedCounterException.Kind` that classifies the failure so callers can make fine-grained decisions (retry strategy, log level, alert routing) without coupling the Synapse layer to any specific backing store or client library.

The convenience method `isTransient()` derives the transient/permanent split from `DistributedCounterException.Kind`, keeping existing callers compatible.

See Also:
  - Serialized Form

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `DistributedCounterException.Kind`
  Classifies the nature of the distributed-counter failure in infrastructure-neutral terms.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DistributedCounterException(String message, Throwable cause, DistributedCounterException.Kind kind)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DistributedCounterException.Kind`
  `getKind()`
  Returns the structured failure kind for fine-grained handling.
  `boolean`
  `isTransient()`
  Returns `true` if this exception represents a transient infrastructure failure (`DistributedCounterException.Kind.CONNECTION_FAILURE` or `DistributedCounterException.Kind.POOL_EXHAUSTED`) that may succeed on retry.

  ### Methods inherited from class java.lang.Throwable

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### DistributedCounterException

    public DistributedCounterException(String message, Throwable cause, DistributedCounterException.Kind kind)

- ## Method Details

  - ### getKind

    public DistributedCounterException.Kind getKind()
    Returns the structured failure kind for fine-grained handling.

  - ### isTransient

    public boolean isTransient()
    Returns `true` if this exception represents a transient infrastructure failure (`DistributedCounterException.Kind.CONNECTION_FAILURE` or `DistributedCounterException.Kind.POOL_EXHAUSTED`) that may succeed on retry. Returns `false` for permanent errors.