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
... and more.

This implementation executes this cross cutting functionality as a 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

    Constructors
    Constructor
    Description
    SharedCamelInternalProcessor(org.apache.camel.CamelContext camelContext, org.apache.camel.spi.CamelInternalProcessorAdvice<?>... advices)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    continueProcessing(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor)
    Strategy to determine if we should continue processing the Exchange.
    boolean
    process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback originalCallback, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor)
    Asynchronous API
    void
    process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncProcessor processor, org.apache.camel.Processor resultProcessor)
    Synchronous API

    Methods 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 interface org.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 interface org.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 the Exchange.