|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.impl.ServiceSupport
org.apache.camel.processor.DelegateProcessor
org.apache.camel.processor.DelayProcessorSupport
public abstract class DelayProcessorSupport
A useful base class for any processor which provides some kind of throttling or delayed processing
Constructor Summary | |
---|---|
DelayProcessorSupport(Processor processor)
|
Method Summary | |
---|---|
protected long |
currentSystemTime()
|
protected abstract void |
delay(Exchange exchange)
|
protected void |
doStop()
|
protected void |
handleSleepInteruptedException(InterruptedException e)
Called when a sleep is interupted; allows derived classes to handle this case differently |
boolean |
isFastStop()
|
void |
process(Exchange exchange)
Processes the message exchange |
void |
setFastStop(boolean fastStop)
Enables & disables a fast stop; basically to avoid waiting a possibly long time for delays to complete before the context shuts down; instead the current processing method throws AlreadyStoppedException to terminate processing. |
protected void |
sleep(long delay)
|
protected void |
waitUntil(long time,
Exchange exchange)
Wait until the given system time before continuing |
Methods inherited from class org.apache.camel.processor.DelegateProcessor |
---|
doStart, getProcessor, proceed, processNext, setProcessor, toString |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
---|
addChildService, getThreadName, isStarted, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DelayProcessorSupport(Processor processor)
Method Detail |
---|
public void process(Exchange exchange) throws Exception
Processor
process
in interface Processor
process
in class DelegateProcessor
Exception
- if an internal processing error has occurred.public boolean isFastStop()
public void setFastStop(boolean fastStop)
AlreadyStoppedException
to terminate processing.
protected void doStop() throws Exception
doStop
in class DelegateProcessor
Exception
protected abstract void delay(Exchange exchange) throws Exception
Exception
protected void waitUntil(long time, Exchange exchange) throws Exception
time
- the system time to wait forexchange
- the exchange being processed
Exception
protected void sleep(long delay) throws InterruptedException
InterruptedException
protected void handleSleepInteruptedException(InterruptedException e)
protected long currentSystemTime()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |