Package org.apache.camel.processor
Class AbstractThrottler
java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.AsyncProcessorSupport
org.apache.camel.processor.AbstractThrottler
- All Implemented Interfaces:
AutoCloseable,org.apache.camel.AsyncProcessor,org.apache.camel.Processor,Throttler,org.apache.camel.Service,org.apache.camel.ShutdownableService,org.apache.camel.spi.HasId,org.apache.camel.spi.IdAware,org.apache.camel.spi.RouteIdAware,org.apache.camel.StatefulService,org.apache.camel.SuspendableService,org.apache.camel.Traceable
- Direct Known Subclasses:
ConcurrentRequestsThrottler,TotalRequestsThrottler
public abstract class AbstractThrottler
extends org.apache.camel.support.AsyncProcessorSupport
implements org.apache.camel.Traceable, org.apache.camel.spi.IdAware, org.apache.camel.spi.RouteIdAware, Throttler
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final ScheduledExecutorServiceprotected booleanprotected final org.apache.camel.CamelContextprotected final org.apache.camel.Expressionprotected static final Stringprotected Stringprotected org.apache.camel.Expressionprotected static final Stringprotected static final Stringprotected booleanprotected Stringprotected final booleanFields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING -
Method Summary
Modifier and TypeMethodDescriptiongetId()org.apache.camel.Expressionabstract StringgetMode()protected static booleanhandleException(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, Exception t, boolean doneSync) protected static booleanhandleInterrupt(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, InterruptedException e, boolean doneSync) booleanbooleanbooleanvoidsetAsyncDelayed(boolean asyncDelayed) voidsetCallerRunsWhenRejected(boolean callerRunsWhenRejected) voidvoidsetMaximumRequestsExpression(org.apache.camel.Expression maxConcurrentRequestsExpression) Sets the maximum number of concurrent requests.voidsetRejectExecution(boolean rejectExecution) voidsetRouteId(String routeId) Methods inherited from class org.apache.camel.support.AsyncProcessorSupport
process, processAsyncMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.AsyncProcessor
processMethods inherited from interface org.apache.camel.spi.IdAware
setGeneratedIdMethods inherited from interface org.apache.camel.Processor
processMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspendMethods inherited from interface org.apache.camel.processor.Throttler
getCurrentMaximumRequestsMethods inherited from interface org.apache.camel.Traceable
getTraceLabel
-
Field Details
-
DEFAULT_KEY
- See Also:
-
PROPERTY_EXCHANGE_QUEUED_TIMESTAMP
- See Also:
-
PROPERTY_EXCHANGE_STATE
- See Also:
-
asyncExecutor
-
shutdownAsyncExecutor
protected final boolean shutdownAsyncExecutor -
camelContext
protected final org.apache.camel.CamelContext camelContext -
correlationExpression
protected final org.apache.camel.Expression correlationExpression -
id
-
routeId
-
rejectExecution
protected boolean rejectExecution -
asyncDelayed
protected boolean asyncDelayed -
callerRunsWhenRejected
protected boolean callerRunsWhenRejected -
maxRequestsExpression
protected org.apache.camel.Expression maxRequestsExpression
-
-
Method Details
-
handleInterrupt
protected static boolean handleInterrupt(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, InterruptedException e, boolean doneSync) -
handleException
protected static boolean handleException(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, Exception t, boolean doneSync) -
isRejectExecution
public boolean isRejectExecution()- Specified by:
isRejectExecutionin interfaceThrottler
-
setRejectExecution
public void setRejectExecution(boolean rejectExecution) -
isAsyncDelayed
public boolean isAsyncDelayed()- Specified by:
isAsyncDelayedin interfaceThrottler
-
setAsyncDelayed
public void setAsyncDelayed(boolean asyncDelayed) -
getId
- Specified by:
getIdin interfaceorg.apache.camel.spi.HasId
-
setId
- Specified by:
setIdin interfaceorg.apache.camel.spi.IdAware
-
getRouteId
- Specified by:
getRouteIdin interfaceorg.apache.camel.spi.RouteIdAware
-
setRouteId
- Specified by:
setRouteIdin interfaceorg.apache.camel.spi.RouteIdAware
-
isCallerRunsWhenRejected
public boolean isCallerRunsWhenRejected()- Specified by:
isCallerRunsWhenRejectedin interfaceThrottler
-
setCallerRunsWhenRejected
public void setCallerRunsWhenRejected(boolean callerRunsWhenRejected) -
setMaximumRequestsExpression
public void setMaximumRequestsExpression(org.apache.camel.Expression maxConcurrentRequestsExpression) Sets the maximum number of concurrent requests.- Specified by:
setMaximumRequestsExpressionin interfaceThrottler
-
getMaximumRequestsExpression
public org.apache.camel.Expression getMaximumRequestsExpression() -
getMode
-