Class SharedCamelInternalProcessor


  • public class SharedCamelInternalProcessor
    extends Object
    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

      All Methods Instance Methods Concrete Methods 
      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
    • Constructor Detail

      • SharedCamelInternalProcessor

        public SharedCamelInternalProcessor​(org.apache.camel.CamelContext camelContext,
                                            org.apache.camel.spi.CamelInternalProcessorAdvice... advices)
    • Method Detail

      • process

        public void process​(org.apache.camel.Exchange exchange,
                            org.apache.camel.AsyncProcessor processor,
                            org.apache.camel.Processor resultProcessor)
        Synchronous API
      • 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
      • continueProcessing

        protected boolean continueProcessing​(org.apache.camel.Exchange exchange,
                                             org.apache.camel.AsyncProcessor processor)
        Strategy to determine if we should continue processing the Exchange.