public abstract class DelayProcessorSupport
extends org.apache.camel.support.processor.DelegateAsyncProcessor
implements org.apache.camel.spi.ShutdownAware
Constructor and Description |
---|
DelayProcessorSupport(org.apache.camel.CamelContext camelContext,
org.apache.camel.Processor processor) |
DelayProcessorSupport(org.apache.camel.CamelContext camelContext,
org.apache.camel.Processor processor,
ScheduledExecutorService executorService,
boolean shutdownExecutorService) |
Modifier and Type | Method and Description |
---|---|
protected abstract long |
calculateDelay(org.apache.camel.Exchange exchange) |
protected long |
currentSystemTime() |
boolean |
deferShutdown(org.apache.camel.ShutdownRunningTask shutdownRunningTask) |
protected void |
delay(long delay,
org.apache.camel.Exchange exchange)
Delays the given time before continuing.
|
protected void |
doShutdown() |
protected void |
doStart() |
int |
getDelayedCount()
Gets the current number of
Exchange s being delayed (hold back due throttle limit hit) |
int |
getPendingExchangesSize() |
protected void |
handleSleepInterruptedException(InterruptedException e,
org.apache.camel.Exchange exchange)
Called when a sleep is interrupted; allows derived classes to handle this case differently
|
boolean |
isAsyncDelayed() |
boolean |
isCallerRunsWhenRejected() |
void |
prepareShutdown(boolean suspendOnly,
boolean forced) |
boolean |
process(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback) |
protected boolean |
processDelay(org.apache.camel.Exchange exchange,
org.apache.camel.AsyncCallback callback,
long delay) |
void |
setAsyncDelayed(boolean asyncDelayed) |
void |
setCallerRunsWhenRejected(boolean callerRunsWhenRejected) |
doStop, getProcessor, hasNext, next, setProcessor, setProcessor, toString
build, doBuild, doInit, doResume, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public DelayProcessorSupport(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor)
public DelayProcessorSupport(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, ScheduledExecutorService executorService, boolean shutdownExecutorService)
protected boolean processDelay(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback, long delay)
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
process
in interface org.apache.camel.AsyncProcessor
process
in class org.apache.camel.support.processor.DelegateAsyncProcessor
public boolean isAsyncDelayed()
public void setAsyncDelayed(boolean asyncDelayed)
public boolean isCallerRunsWhenRejected()
public void setCallerRunsWhenRejected(boolean callerRunsWhenRejected)
protected abstract long calculateDelay(org.apache.camel.Exchange exchange)
public int getDelayedCount()
Exchange
s being delayed (hold back due throttle limit hit)protected void delay(long delay, org.apache.camel.Exchange exchange) throws InterruptedException
delay
- the delay time in millisexchange
- the exchange being processedInterruptedException
protected void handleSleepInterruptedException(InterruptedException e, org.apache.camel.Exchange exchange) throws InterruptedException
InterruptedException
protected long currentSystemTime()
protected void doStart() throws Exception
doStart
in class org.apache.camel.support.processor.DelegateAsyncProcessor
Exception
protected void doShutdown() throws Exception
doShutdown
in class org.apache.camel.support.processor.DelegateAsyncProcessor
Exception
public boolean deferShutdown(org.apache.camel.ShutdownRunningTask shutdownRunningTask)
deferShutdown
in interface org.apache.camel.spi.ShutdownAware
public int getPendingExchangesSize()
getPendingExchangesSize
in interface org.apache.camel.spi.ShutdownAware
public void prepareShutdown(boolean suspendOnly, boolean forced)
prepareShutdown
in interface org.apache.camel.spi.ShutdownPrepared
Apache Camel