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
Exchanges 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, toStringbuild, doBuild, doInit, doResume, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic 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.AsyncProcessorprocess in class org.apache.camel.support.processor.DelegateAsyncProcessorpublic 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()
Exchanges 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 processedInterruptedExceptionprotected void handleSleepInterruptedException(InterruptedException e, org.apache.camel.Exchange exchange) throws InterruptedException
InterruptedExceptionprotected long currentSystemTime()
protected void doStart()
throws Exception
doStart in class org.apache.camel.support.processor.DelegateAsyncProcessorExceptionprotected void doShutdown()
throws Exception
doShutdown in class org.apache.camel.support.processor.DelegateAsyncProcessorExceptionpublic boolean deferShutdown(org.apache.camel.ShutdownRunningTask shutdownRunningTask)
deferShutdown in interface org.apache.camel.spi.ShutdownAwarepublic int getPendingExchangesSize()
getPendingExchangesSize in interface org.apache.camel.spi.ShutdownAwarepublic void prepareShutdown(boolean suspendOnly,
boolean forced)
prepareShutdown in interface org.apache.camel.spi.ShutdownPreparedApache Camel