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
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected final ScheduledExecutorService
protected boolean
protected final org.apache.camel.CamelContext
protected final org.apache.camel.Expression
protected static final String
protected String
protected org.apache.camel.Expression
protected static final String
protected static final String
protected boolean
protected String
protected final boolean
Fields 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.Expression
abstract String
getMode()
protected static boolean
handleException
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, Exception t, boolean doneSync) protected static boolean
handleInterrupt
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, InterruptedException e, boolean doneSync) boolean
boolean
boolean
void
setAsyncDelayed
(boolean asyncDelayed) void
setCallerRunsWhenRejected
(boolean callerRunsWhenRejected) void
void
setMaximumRequestsExpression
(org.apache.camel.Expression maxConcurrentRequestsExpression) Sets the maximum number of concurrent requests.void
setRejectExecution
(boolean rejectExecution) void
setRouteId
(String routeId) Methods inherited from class org.apache.camel.support.AsyncProcessorSupport
process, processAsync
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.AsyncProcessor
process
Methods inherited from interface org.apache.camel.spi.IdAware
setGeneratedId
Methods inherited from interface org.apache.camel.Processor
process
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
Methods inherited from interface org.apache.camel.processor.Throttler
getCurrentMaximumRequests
Methods 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:
isRejectExecution
in interfaceThrottler
-
setRejectExecution
public void setRejectExecution(boolean rejectExecution) -
isAsyncDelayed
public boolean isAsyncDelayed()- Specified by:
isAsyncDelayed
in interfaceThrottler
-
setAsyncDelayed
public void setAsyncDelayed(boolean asyncDelayed) -
getId
- Specified by:
getId
in interfaceorg.apache.camel.spi.HasId
-
setId
- Specified by:
setId
in interfaceorg.apache.camel.spi.IdAware
-
getRouteId
- Specified by:
getRouteId
in interfaceorg.apache.camel.spi.RouteIdAware
-
setRouteId
- Specified by:
setRouteId
in interfaceorg.apache.camel.spi.RouteIdAware
-
isCallerRunsWhenRejected
public boolean isCallerRunsWhenRejected()- Specified by:
isCallerRunsWhenRejected
in 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:
setMaximumRequestsExpression
in interfaceThrottler
-
getMaximumRequestsExpression
public org.apache.camel.Expression getMaximumRequestsExpression() -
getMode
-