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
    Modifier and Type
    Class
    Description
    protected static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected 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 Type
    Method
    Description
     
    org.apache.camel.Expression
     
    abstract String
     
     
    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

      protected static final String DEFAULT_KEY
      See Also:
    • PROPERTY_EXCHANGE_QUEUED_TIMESTAMP

      protected static final String PROPERTY_EXCHANGE_QUEUED_TIMESTAMP
      See Also:
    • PROPERTY_EXCHANGE_STATE

      protected static final String PROPERTY_EXCHANGE_STATE
      See Also:
    • asyncExecutor

      protected final ScheduledExecutorService asyncExecutor
    • shutdownAsyncExecutor

      protected final boolean shutdownAsyncExecutor
    • camelContext

      protected final org.apache.camel.CamelContext camelContext
    • correlationExpression

      protected final org.apache.camel.Expression correlationExpression
    • id

      protected String id
    • routeId

      protected String 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 interface Throttler
    • setRejectExecution

      public void setRejectExecution(boolean rejectExecution)
    • isAsyncDelayed

      public boolean isAsyncDelayed()
      Specified by:
      isAsyncDelayed in interface Throttler
    • setAsyncDelayed

      public void setAsyncDelayed(boolean asyncDelayed)
    • getId

      public String getId()
      Specified by:
      getId in interface org.apache.camel.spi.HasId
    • setId

      public void setId(String id)
      Specified by:
      setId in interface org.apache.camel.spi.IdAware
    • getRouteId

      public String getRouteId()
      Specified by:
      getRouteId in interface org.apache.camel.spi.RouteIdAware
    • setRouteId

      public void setRouteId(String routeId)
      Specified by:
      setRouteId in interface org.apache.camel.spi.RouteIdAware
    • isCallerRunsWhenRejected

      public boolean isCallerRunsWhenRejected()
      Specified by:
      isCallerRunsWhenRejected in interface Throttler
    • 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 interface Throttler
    • getMaximumRequestsExpression

      public org.apache.camel.Expression getMaximumRequestsExpression()
    • getMode

      public abstract String getMode()
      Specified by:
      getMode in interface Throttler