org.apache.camel.processor
Class Delayer
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.processor.DelegateProcessor
org.apache.camel.processor.DelayProcessorSupport
org.apache.camel.processor.Delayer
- All Implemented Interfaces:
- Processor, Service
public class Delayer
- extends DelayProcessorSupport
A Delayer which
delays processing the exchange until the correct amount of time has elapsed
using an expression to determine the delivery time.
For example if you
wish to delay JMS messages by 25 seconds from their publish time you could
create an instance of this class with the expression
header("JMSTimestamp")
and a delay value of 25000L.
- Version:
- $Revision: 35332 $
Method Summary |
protected long |
defaultProcessTime(Exchange exchange)
A Strategy Method to allow derived implementations to decide the current
system time or some other default exchange property |
protected void |
delay(Exchange exchange)
Waits for an optional time period before continuing to process the
exchange |
long |
getDelay()
|
void |
setDelay(long delay)
Sets the delay from the publish time; which is typically the time from
the expression or the current system time if none is available |
String |
toString()
|
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, getThreadName, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, nextThreadCounter, removeChildService, start, stop |
Delayer
public Delayer(Processor processor,
Expression<Exchange> timeExpression,
long delay)
toString
public String toString()
- Overrides:
toString
in class DelegateProcessor
getDelay
public long getDelay()
setDelay
public void setDelay(long delay)
- Sets the delay from the publish time; which is typically the time from
the expression or the current system time if none is available
delay
protected void delay(Exchange exchange)
throws Exception
- Waits for an optional time period before continuing to process the
exchange
- Specified by:
delay
in class DelayProcessorSupport
- Throws:
Exception
defaultProcessTime
protected long defaultProcessTime(Exchange exchange)
- A Strategy Method to allow derived implementations to decide the current
system time or some other default exchange property
- Parameters:
exchange
-
Copyright © 2009 IONA Open Source Community. All Rights Reserved.