org.apache.camel.processor
Class DelayProcessorSupport
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.processor.DelegateProcessor
org.apache.camel.processor.DelayProcessorSupport
- All Implemented Interfaces:
- Processor, Service
- Direct Known Subclasses:
- Delayer, DelayInterceptor, Throttler
public abstract class DelayProcessorSupport
- extends DelegateProcessor
A useful base class for any processor which provides some kind of throttling
or delayed processing
- Version:
- $Revision: 1257 $
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
DelayProcessorSupport
public DelayProcessorSupport(Processor processor)
process
public void process(Exchange exchange)
throws Exception
- Description copied from interface:
Processor
- Processes the message exchange
- Specified by:
process
in interface Processor
- Overrides:
process
in class DelegateProcessor
- Throws:
Exception
- if an internal processing error has occurred.
isFastStop
public boolean isFastStop()
setFastStop
public 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.
doStop
protected void doStop()
throws Exception
- Overrides:
doStop
in class DelegateProcessor
- Throws:
Exception
delay
protected abstract void delay(Exchange exchange)
throws Exception
- Throws:
Exception
waitUntil
protected void waitUntil(long time,
Exchange exchange)
throws Exception
- Wait until the given system time before continuing
- Parameters:
time
- the system time to wait forexchange
- the exchange being processed
- Throws:
Exception
sleep
protected void sleep(long delay)
throws InterruptedException
- Throws:
InterruptedException
handleSleepInteruptedException
protected void handleSleepInteruptedException(InterruptedException e)
- Called when a sleep is interupted; allows derived classes to handle this
case differently
currentSystemTime
protected long currentSystemTime()
Copyright © 2010 IONA Open Source Community. All Rights Reserved.