Class ConcurrentAccessController
java.lang.Object
org.apache.synapse.commons.throttle.core.ConcurrentAccessController
- All Implemented Interfaces:
Serializable
Controls the concurrent access through throttle to the system based on policy
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintDecrements by one the current value and Returns the previous valueintgetLimit()Gets the Max number of access - access limitintIncrements by one the current value and Returns the the updated valuevoidset(int newValue) Resets the counter and the limitvoidupdateCounter(boolean isIncrement)
-
Constructor Details
-
ConcurrentAccessController
public ConcurrentAccessController(int limit)
-
-
Method Details
-
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)
-