public abstract class DelayProcessorSupport
extends org.apache.camel.support.processor.DelegateAsyncProcessor
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() |
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) |
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() |
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, doFail, doInit, doLifecycleChange, doResume, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
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
Apache Camel