Package org.apache.camel.processor
Class TotalRequestsThrottler.ThrottlingState
java.lang.Object
org.apache.camel.processor.TotalRequestsThrottler.ThrottlingState
- Enclosing class:
TotalRequestsThrottler
-
Method Summary
Modifier and TypeMethodDescriptionvoidcalculateAndSetMaxRequestsPerPeriod(org.apache.camel.Exchange exchange) Evaluates the maxRequestsPerPeriodExpression and adjusts the throttle rate up or down.voidclean()voidenqueue(org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermit permit, org.apache.camel.Exchange exchange) Returns a permit to the DelayQueue, first resetting it's delay to be relative to now.intorg.apache.camel.processor.TotalRequestsThrottler.ThrottlePermitpeek()org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermitpoll()org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermittake()
-
Method Details
-
getThrottleRate
public int getThrottleRate() -
poll
public org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermit poll() -
peek
public org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermit peek() -
take
public org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermit take() throws InterruptedException- Throws:
InterruptedException
-
clean
public void clean() -
enqueue
public void enqueue(org.apache.camel.processor.TotalRequestsThrottler.ThrottlePermit permit, org.apache.camel.Exchange exchange) Returns a permit to the DelayQueue, first resetting it's delay to be relative to now. -
calculateAndSetMaxRequestsPerPeriod
public void calculateAndSetMaxRequestsPerPeriod(org.apache.camel.Exchange exchange) throws Exception Evaluates the maxRequestsPerPeriodExpression and adjusts the throttle rate up or down.- Throws:
Exception
-