Package org.awsutils.sqs.config
Class AbstractLocalRateLimiter
java.lang.Object
org.awsutils.sqs.config.AbstractLocalRateLimiter
- All Implemented Interfaces:
org.awsutils.common.ratelimiter.RateLimiter,org.awsutils.common.ratelimiter.RateLimiterReload
- Direct Known Subclasses:
LocalRateLimiter
public abstract class AbstractLocalRateLimiter
extends Object
implements org.awsutils.common.ratelimiter.RateLimiter, org.awsutils.common.ratelimiter.RateLimiterReload
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractLocalRateLimiter(String rateLimiterKey, String rateLimiterTimeUnitKey, org.springframework.core.env.Environment environment) -
Method Summary
Modifier and TypeMethodDescriptionintbooleaninit()voidChecks the instance level rate value against the value in FF4J and reloads the RateLimiter instance if they are different.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.awsutils.common.ratelimiter.RateLimiter
execute, execute
-
Constructor Details
-
AbstractLocalRateLimiter
-
-
Method Details
-
hasExceededMaxRate
public boolean hasExceededMaxRate()- Specified by:
hasExceededMaxRatein interfaceorg.awsutils.common.ratelimiter.RateLimiter
-
getMaxRate
public int getMaxRate()- Specified by:
getMaxRatein interfaceorg.awsutils.common.ratelimiter.RateLimiter
-
getRateLimiterName
- Specified by:
getRateLimiterNamein interfaceorg.awsutils.common.ratelimiter.RateLimiter
-
init
-
refreshIfRateChanged
public void refreshIfRateChanged()Checks the instance level rate value against the value in FF4J and reloads the RateLimiter instance if they are different.- Specified by:
refreshIfRateChangedin interfaceorg.awsutils.common.ratelimiter.RateLimiterReload
-