Package org.apache.camel.impl.engine
Class SharedCamelInternalProcessor
java.lang.Object
org.apache.camel.impl.engine.SharedCamelInternalProcessor
- All Implemented Interfaces:
org.apache.camel.Processor
,org.apache.camel.spi.SharedInternalProcessor
public class SharedCamelInternalProcessor
extends Object
implements org.apache.camel.spi.SharedInternalProcessor
A Shared (thread safe) internal
Processor
that Camel routing engine used during routing for cross cutting
functionality such as:
- Execute
UnitOfWork
- Keeping track which route currently is being routed
- Execute
RoutePolicy
- Gather JMX performance statics
- Tracing
- Debugging
- Message History
- Stream Caching
Transformer
CamelInternalProcessorAdvice
advice
(before and after advice) by executing the CamelInternalProcessorAdvice.before(Exchange)
and
CamelInternalProcessorAdvice.after(Exchange, Object)
callbacks in correct order during routing. This reduces
number of stack frames needed during routing, and reduce the number of lines in stacktraces, as well makes debugging
the routing engine easier for end users.
Debugging tips: Camel end users whom want to debug their Camel applications with the Camel source code, then
make sure to read the source code of this class about the debugging tips, which you can find in the
process(Exchange, AsyncCallback, AsyncProcessor, Processor)
method.
The added advices can implement Ordered
to control in which order the advices are executed.-
Constructor Summary
ConstructorDescriptionSharedCamelInternalProcessor
(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelInternalProcessorAdvice<?>... advices) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
continueProcessing
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor) Strategy to determine if we should continue processing theExchange
.boolean
process
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor) Asynchronous APIvoid
process
(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor) Synchronous APIMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.camel.spi.SharedInternalProcessor
process
-
Constructor Details
-
SharedCamelInternalProcessor
public SharedCamelInternalProcessor(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelInternalProcessorAdvice<?>... advices)
-
-
Method Details
-
process
public void process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor) Synchronous API- Specified by:
process
in interfaceorg.apache.camel.spi.SharedInternalProcessor
-
process
public boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor) Asynchronous API- Specified by:
process
in interfaceorg.apache.camel.spi.SharedInternalProcessor
-
continueProcessing
protected boolean continueProcessing(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor) Strategy to determine if we should continue processing theExchange
.
-