public class Throttler extends DelayProcessorSupport implements Traceable, IdAware
| Modifier and Type | Class and Description |
|---|---|
protected class |
Throttler.TimeSlot |
logprocessorshutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
Throttler(CamelContext camelContext,
Processor processor,
Expression maxRequestsPerPeriodExpression,
long timePeriodMillis,
ScheduledExecutorService executorService,
boolean shutdownExecutorService,
boolean rejectExecution) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
calculateDelay(Exchange exchange) |
long |
getCurrentMaximumRequestsPerPeriod()
Gets the current maximum request per period value.
|
String |
getId()
Returns the id
|
Expression |
getMaximumRequestsPerPeriodExpression() |
long |
getTimePeriodMillis() |
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled.
|
boolean |
isRejectExecution() |
protected Throttler.TimeSlot |
nextSlot() |
protected boolean |
processDelay(Exchange exchange,
AsyncCallback callback,
long delay) |
void |
setId(String id)
Sets the id
|
void |
setMaximumRequestsPerPeriodExpression(Expression maxRequestsPerPeriodExpression)
Sets the maximum number of requests per time period expression
|
void |
setRejectExecution(boolean rejectExecution) |
void |
setTimePeriodMillis(long timePeriodMillis)
Sets the time period during which the maximum number of requests apply
|
String |
toString() |
currentSystemTime, delay, doShutdown, doStart, getDelayedCount, handleSleepInterruptedException, isAsyncDelayed, isCallerRunsWhenRejected, process, setAsyncDelayed, setCallerRunsWhenRejecteddoStop, getProcessor, hasNext, next, process, processNext, setProcessor, setProcessordoResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic Throttler(CamelContext camelContext, Processor processor, Expression maxRequestsPerPeriodExpression, long timePeriodMillis, ScheduledExecutorService executorService, boolean shutdownExecutorService, boolean rejectExecution)
public String toString()
toString in class DelegateAsyncProcessorpublic String getTraceLabel()
TraceablegetTraceLabel in interface Traceablepublic 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 DelayProcessorSupportprotected Throttler.TimeSlot nextSlot()
public boolean isRejectExecution()
public void setRejectExecution(boolean rejectExecution)
protected boolean processDelay(Exchange exchange, AsyncCallback callback, long delay)
processDelay in class DelayProcessorSupportApache Camel