public class LoopProcessor extends DelegateAsyncProcessor implements Traceable, IdAware
processorshutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
LoopProcessor(Processor processor,
Expression expression,
Predicate predicate,
boolean copy) |
| Modifier and Type | Method and Description |
|---|---|
Expression |
getExpression() |
String |
getId()
Returns the id
|
Predicate |
getPredicate() |
String |
getTraceLabel()
Gets the trace label used for logging when tracing is enabled.
|
boolean |
isCopy() |
protected Exchange |
prepareExchange(Exchange exchange,
int index,
Exchange original)
Prepares the exchange for the next iteration
|
boolean |
process(Exchange exchange,
AsyncCallback callback)
Processes the message exchange.
|
protected boolean |
process(Exchange exchange,
AsyncCallback callback,
AtomicInteger index,
AtomicInteger count,
AtomicBoolean doWhile,
Exchange original) |
void |
setId(String id)
Sets the id
|
String |
toString() |
doShutdown, doStart, doStop, getProcessor, hasNext, next, process, processNext, setProcessor, setProcessordoResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic LoopProcessor(Processor processor, Expression expression, Predicate predicate, boolean copy)
public boolean process(Exchange exchange, AsyncCallback callback)
AsyncProcessorProcessor.process(org.apache.camel.Exchange), but the caller supports having the exchange asynchronously processed.
If there was a failure processing then the caused Exception would be set on the Exchange.process in interface AsyncProcessorprocess in class DelegateAsyncProcessorexchange - the message exchangecallback - the AsyncCallback will be invoked when the processing of the exchange is completed.
If the exchange is completed synchronously, then the callback is also invoked synchronously.
The callback should therefore be careful of starting recursive loop.protected boolean process(Exchange exchange, AsyncCallback callback, AtomicInteger index, AtomicInteger count, AtomicBoolean doWhile, Exchange original)
protected Exchange prepareExchange(Exchange exchange, int index, Exchange original)
exchange - the exchangeindex - the index of the next iterationpublic Expression getExpression()
public Predicate getPredicate()
public boolean isCopy()
public String getTraceLabel()
TraceablegetTraceLabel in interface Traceablepublic String toString()
toString in class DelegateAsyncProcessorApache Camel