Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-527 Break dependency cycle between camel and camel.impl
  3. CAMEL-541

The spi package should not depend on the processor package

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0, 1.4.0
    • 2.0-M1
    • camel-core
    • None

    Description

      I have found one other problem in RouteContext. The method intercept uses the class Interceptor from processor. I think Interceptor should be an interface that should reside in spi or camel. So we could avoid referencing the processor package from spi.

      When I look into the current Interceptor implementation I think the two main methods that need to be in the interface are process and proceed. Process can be inherited from Processor but proceed is only declared in the implementation class DelegateProcessor. So I think the clean way to handle this would be to create an interface DelegateProcessor and a spearate DefaultDelegateProcessor.

      public interface DelegateProcessor extends Processor

      { /** * Proceed with the underlying delegated processor */ public abstract void proceed(Exchange exchange) throws Exception; }

      and an interface Interceptor

      public interface Interceptor extends DelegateProcessor {
      public abstract void process(Exchange exchange) throws Exception; public abstract Processor getInterceptorLogic(); public abstract void setInterceptorLogic(Processor interceptorLogic);
      }

      When we put these to spi and use them instead of the implementations where possible the spi would not depend on processor anymore.

      Attachments

        1. interceptor.patch
          32 kB
          Christian Schneider

        Activity

          People

            davsclaus Claus Ibsen
            cschneider Christian Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: