org.apache.synapse.commons.throttle.core

## Class ConcurrentAccessController

- java.lang.Object
- - org.apache.synapse.commons.throttle.core.ConcurrentAccessController

- All Implemented Interfaces:
    java.io.Serializable

      public class ConcurrentAccessController
      extends java.lang.Object
      implements java.io.Serializable

  Controls the concurrent access through throttle to the system based on policy
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConcurrentAccessController(int limit)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getAndDecrement()` Decrements by one the current value and Returns the previous value
    `int` | `getLimit()` Gets the Max number of access - access limit
    `int` | `incrementAndGet()` Increments by one the current value and Returns the the updated value
    `void` | `set(int newValue)` Resets the counter and the limit
    `void` | `updateCounter(boolean isIncrement)`

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

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

- - ### Constructor Detail

    - #### ConcurrentAccessController

          public ConcurrentAccessController(int limit)

  - ### Method Detail

    - #### getAndDecrement

          public int getAndDecrement()

      Decrements by one the current value and Returns the previous value
      Returns:
        the previous value

    - #### incrementAndGet

          public int incrementAndGet()

      Increments by one the current value and Returns the the updated value
      Returns:
        the updated value

    - #### getLimit

          public int getLimit()

      Gets the Max number of access - access limit
      Returns:
        the limit

    - #### set

          public void set(int newValue)

      Resets the counter and the limit
      Parameters:
        `newValue` - The new Value

    - #### updateCounter

          public void updateCounter(boolean isIncrement)

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.