public class Throttler extends DelayProcessorSupport implements Traceable
Modifier and Type | Class and Description |
---|---|
protected class |
Throttler.TimeSlot |
log
processor
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
Throttler(CamelContext camelContext,
Processor processor,
Expression maxRequestsPerPeriodExpression,
long timePeriodMillis,
ScheduledExecutorService executorService,
boolean shutdownExecutorService) |
Modifier and Type | Method and Description |
---|---|
protected long |
calculateDelay(Exchange exchange) |
long |
getCurrentMaximumRequestsPerPeriod()
Gets the current maximum request per period value.
|
Expression |
getMaximumRequestsPerPeriodExpression() |
long |
getTimePeriodMillis() |
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled.
|
protected Throttler.TimeSlot |
nextSlot() |
void |
setMaximumRequestsPerPeriodExpression(Expression maxRequestsPerPeriodExpression)
Sets the maximum number of requests per time period expression
|
void |
setTimePeriodMillis(long timePeriodMillis)
Sets the time period during which the maximum number of requests apply
|
String |
toString() |
currentSystemTime, delay, doShutdown, doStart, handleSleepInterruptedException, isAsyncDelayed, isCallerRunsWhenRejected, process, setAsyncDelayed, setCallerRunsWhenRejected
doStop, getProcessor, hasNext, next, process, processNext, setProcessor, setProcessor
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
public Throttler(CamelContext camelContext, Processor processor, Expression maxRequestsPerPeriodExpression, long timePeriodMillis, ScheduledExecutorService executorService, boolean shutdownExecutorService)
public String toString()
toString
in class DelegateAsyncProcessor
public String getTraceLabel()
Traceable
getTraceLabel
in interface Traceable
public void setMaximumRequestsPerPeriodExpression(Expression maxRequestsPerPeriodExpression)
public Expression getMaximumRequestsPerPeriodExpression()
public long getTimePeriodMillis()
public long getCurrentMaximumRequestsPerPeriod()
public void setTimePeriodMillis(long timePeriodMillis)
protected long calculateDelay(Exchange exchange)
calculateDelay
in class DelayProcessorSupport
protected Throttler.TimeSlot nextSlot()
Apache Camel